|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
04-17-2006 07:17
Based on what I read in the Wiki, I have been using the following to get the rotation need for rotat a prim: startRot = llGetRot(); // Starting with the prim at whatever its current rotation eul = <0,0,235>; // Inputting 235 degrees eul *= DEG_TO_RAD; // Converting degrees to radians rotation quat = llEuler2Rot( eul ); // radians to quat(howevertheheckyouspell it) llSetRot(startRot + quat); Turning the prim 5/8 full circle
However, it the results are not correct. Could someone point out my error or give me the correct formula?
Mod
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-17-2006 07:31
If you want to rotate the object 235 degrees about the Z-axis from its current rotation, you need to multiply the rotations in the final step, not add them.
|
|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
Thanks
04-17-2006 08:00
Thanks Ordinal.
|
|
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
|
04-17-2006 12:23
Just in general, adding two rotations (using +) is always going to be the wrong thing to do, unless you're using the rotation data structure in an unusual way. Always use * or / to combine rotations.
_____________________
-Seifert Surface 2G!tGLf 2nLt9cG
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
04-17-2006 16:21
Now if we could only multiply rotations by floats and integers to effect thier magnitude (also a function to get the magnitude and another to return the normal.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|