Jump to content
You are about to reply to a thread that has been inactive for 3182 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

I'm back again with another rotation problem. Rotations always seem to flummox me.

I want to move a prim (it's actually the root of a linked set) in the direction it's facing, whatever it's rotation in the region is. Any help would be greatly appreciated.

 

Posted

The local direction that a prim is facing is always llGetRot(), and "forward" is in the prim's +X direction, so if you want to move a prim in the direction that it's facing, you will want to move it to

llGetPos() + <forward_distance,0.0,0.0>* llGetRot()

  • Like 1
Posted

The multiplication sign is a bit misleading here, since you're not multiplying the vector by anything.   You're translating it.

The reason this can be a source of confusion is that multiplication is commutative; that is, a*b == b*a.   

Translations, on the other hand, certainly aren't commutative, and llSetPos(pos * llGetRot()) means something very different from llSetPos (llGetRot() * pos).

 

Posted

Glad to hear it.  :)

Yeah, you have stepped into an area of math that is really not all that difficult, but it's often neglected in the standard curriculum.  I've never understood why. Matrix algebra is extremely useful as a way to manage geometric manipulations in numerical terms. It has only a handful of fundamental rules. Once you've mastered them, a lot of the mystery of vectors and rotations in SL becomes much clearer.  (It never vanishes, but it does make sense.)  If you're at all interested -- not just frustrated but actually interested enough to figure it out -- I think you'll find it easy to get a basic primer in any good book store.  

Posted

Right. I have that page open and I'll go through it during today. If I don't mange to get a grasp of it today, I'll bookmark it. Thank you, Rolig. You're my hero :) As is Innula, of course :)

Posted

If you haven't already, read this page, too...

http://wiki.secondlife.com/wiki/Rotation

And ignore the math on this page, just read the history...

https://en.wikipedia.org/wiki/Quaternion

I like that Hamilton carved his quaternion equation into a stone bridge on his way to a meeting. I'm the sort who often misses meetings and leaves barely enough time to get to those I remember, let alone carve things in stone along the way.

Posted

That's why rotations always flummox me. Vectors are straight forward but quaternions are not - not to me, anyway. And there's so much reading that I won't go away any the wiser - except that * doesn't multiply. I hadn't known that before. No wonder it always flummoxed me. I had read the LL stuff about rotations and quaternions, but not to the extent of actually understanding it.

You are about to reply to a thread that has been inactive for 3182 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...