Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Q: rotating around a central axis?

Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
02-19-2005 21:16
http://secondlife.com/badgeo/wakka.php?wakka=rotation

On the WIKI it has some tips on rotating a vector through multiplication.

"Note: You can rotate an object around an arbitrary point by multiplying a vector by a rotation ... The vector should be the difference between the object's current position and the desired "center-point" of rotation. Take the result of the multiplication and add it to the object's current position. This vector will be the "new location" the object should be moved to. "

I'm having a wonky bug I'm trying to flush out, and I wanted to be sure...

Do you need to normalize the vector, multiply by the rotation, and then multiply back in the magnitude? Or can you just multiply straight out?
_____________________
Hiro Pendragon
------------------
http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio

Visit my SL blog: http://secondtense.blogspot.com
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
02-20-2005 10:31
I doubt it, but you may well need to make sure the rotation is normalized.
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
02-20-2005 12:59
From: Lex Neva
I doubt it, but you may well need to make sure the rotation is normalized.

It is. The rotations involved are always obtained via operations between llGetRot() values.
_____________________
Hiro Pendragon
------------------
http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio

Visit my SL blog: http://secondtense.blogspot.com
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
02-20-2005 23:05
As far as I know, they don't *need* to be normalized, since you should arrive at the same point no matter how you get there.

However, as a cheap trick in-case LSL calculates it a bit "wonky," as you put it, you could run it through llEuler2Rot(llRot2Euler()) first, thus "normalizing it" as you put it.

Either way, I don't... think - it's necessary. But you could build the process from scratch if need be.

Doubt you'd want to do that, though. :rolleyes:
_____________________
---