Log in or register to post comments

I hope rotate 3D objects real time as animation.

October 31, 2010 - 10:09am #1

Hi, there
I'm here again.
This site is quite useful for me. Thanks. Anyway I have a question.

This class is for rotating as you see below.

SampleUtils::rotatePoseMatrix(float angle, float x, float y, float z,
float* matrix)

I did rotate the object but I hope rotate 3D objects real time as animation.
ex) the earth´s revolution and rotation

I think for doing this, change angle continually. I modified only angle in FrameMarkers.cpp file continally. That's why it didn't work.
Give me a hand.

Re: I hope rotate 3D objects real time as animation.

October 31, 2010 - 10:51am #2

If all you want to do is rotate an object on a marker continuously, you might try something like this:

rotationAngle += 5;  // better to base this on a change in time
SampleUtils::rotatePoseMatrix(rotationAngle, 0, 0, 1, &modelViewMatrix.data[0]);

(Please note there should NOT be a semicolon after the ampersand above. The forum auto-formatting is fighting with me).

Place this code in the FrameMarkers.cpp file just before the translate. Be sure to create a global rotationAngle variable.

- Kim

Log in or register to post comments