Phil Deakins Posted March 19, 2016 Posted March 19, 2016 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.
steph Arnott Posted March 19, 2016 Posted March 19, 2016 Just fix the rotation in a global parameter. Then you could use a test if for what ever reason if it has changed and snap it back.
Rolig Loon Posted March 19, 2016 Posted March 19, 2016 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() 1
Phil Deakins Posted March 19, 2016 Author Posted March 19, 2016 Thank you Rolig. I'll give that a whirl. I did try a test using *llGetRot() but I obviously did it wrong. I have a mental block with rotations in SL.
Innula Zenovka Posted March 19, 2016 Posted March 19, 2016 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).
Phil Deakins Posted March 19, 2016 Author Posted March 19, 2016 A bit misleading? lol It doesn't take much to confuse the hell out of me @Rolig. That worked - ty
Rolig Loon Posted March 19, 2016 Posted March 19, 2016 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.
Phil Deakins Posted March 20, 2016 Author Posted March 20, 2016 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
Madelaine McMasters Posted March 20, 2016 Posted March 20, 2016 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.
Phil Deakins Posted March 20, 2016 Author Posted March 20, 2016 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.
Recommended Posts
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