i've got a problems which i've been trying to solve for a day now I'm rotating an object by and arcball based controller, it's been working great, except all rotations that are clamped in a [0..360] range( after normalizing ). Now i don't want this, because i want to key frame animations, where a range greater than the[0...360] is needed.

Note that you can use ...[/code] to post code on the forum. As for your problem, I would suggest switching to a quaternion representation because it's much easier to work with for things like this than Euler angles. In particular, slerping between two quaternions always follows the shortest path between them, so you don't get the issues with interpolating across the 0-360 boundary that you get with Euler angles. On the other hand this does also mean that animating a spinning object would require around two keyframes per revolution, which might be a lot of keyframes if it's spinning rapidly. [code]...[/code****] to post code on the forum.

As for your problem, I would suggest switching to a quaternion representation because it's much easier to work with for things like this than Euler angles. In particular, slerping between two quaternions always follows the shortest path between them, so you don't get the issues with interpolating across the 0-360 boundary that you get with Euler angles.

On the other hand this does also mean that animating a spinning object would require around two keyframes per revolution, which might be a lot of keyframes if it's spinning rapidly.

Gorgorath
—
2009-12-10T21:22:44Z —
#3

thanks for the reply, but quaternions still dont give me the wanted revolutions( i'm using them btw )

Mark

Gorgorath
—
2009-12-10T22:07:04Z —
#4

all i can think of it is more difficult, when first thought of, quaternions are of course also in the range of [-pi, and pi] but for visual feedback( euler angles ) and keyframing the euler angles should be accumulated, 3d max does it perfectly, i can see myy y axis rotation go down and down, and not jumping back from -1 to 359 for example;)

Mark

v71
—
2009-12-10T22:59:29Z —
#5

Well, if you don't want to use quaternions, you could always divide your variable which holds the rotation value by 360 , so you will know how many rotation your object performed. You have to remove the checks for clamping the value beetween 0..360 , it won't affect the rotation matrix its 24.00 here so i may be wrong on something

rouncer
—
2009-12-11T01:07:40Z —
#6

Do you wanna make it spin? i just use general(arbitrary) axis rotates.

(ed) I cant even tell what you want me to say, sorry shouldnt have posted, maybe you could describe a little more?

Do you wanna make it spin? i just use general(arbitrary) axis rotates. (ed2) storing keyframes, nothing is ever past 360...

Key frames surely can go beyond the [0 360] range

geon
—
2009-12-11T11:29:51Z —
#8

How about using an axis+angle representation?

rouncer
—
2009-12-13T01:43:10Z —
#9

well, all i do is give each rotation a number, it can go around any amount of times who gives a shit. less to less, more to more, 3.6 to 6.6 it goes up (right on the circle) if it goes 6.6 5.6 it goes down (left on the circle.)

well, all i do is give each rotation a number, it can go around any amount of times who gives a shit. less to less, more to more, 3.6 to 6.6 it goes up (right on the circle) if it goes 6.6 5.6 it goes down (left on the circle.) Theres 2 ways to go in a circle and only 2 ways, more or less.

Yes basically that is what i do, works fine for the x and z axis, but the y-axis, jumps from sometimes to 90 to -90( which is logical since the asin() function ) , and the x and a z values increment by

So to conclude, i should be using some 'if else' statements in order to find the correct amount of revolutions..i was trying to avoid them..