Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotating a child prim about its edge

Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
03-14-2006 05:50
I was asking online in the scripters group last night, and somebody claimed that you could rotate a child prim of an object around its edge using a single llSetRot call by "including the translation in the quaternion".

Is this really possible? I looked at the matrix equivalent of a quaternion and the homogenous part seemed to be unit, and also a bit of experimenting revealed that SL seems to normalise rotation quaternions automatically anyway.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-14-2006 06:17
I have a love-hate relationship with quaternions and I'm not an expert - but my understanding of the question and them is no, that's not how they work.

You can combine a translation and a rotation (vector * rotation) to give you an equivalent vector in a different direction.

You can do some smart cuts, dimples etc. (prim torture) to make things rotate about their perceptual edge, or even a perceptual vertex - it's the centre of the whole object but not the object as displayed.

The alternative, which sounds closer to what you're after, is that you rotate the object and translate it in some order. That's two functions, two calls certainly with a child prim. I guess for a whole physical object llSetForceAndTorque does both together.

Of course it's eminently possible I'm wrong - I sort of know how to (usually) stick them together to get the effect I expect and know enough to explain it (sort of) to others - but no way would I claim to understand it really. Jesrad, Siefert and Strife, you out there? You seem to be the big three for this sort of thing, and apologies to anyone else expert on them I've missed out!
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
03-14-2006 11:18
*nods, agrees with Eloise. Also there is a method for rotating a prim about any arbitrary axis in 3D space using a single llSetPrimitiveParams() call, explained in the LSL Wiki under rotations - was there a particular reason for trying to do it with llSetRot()?