[Papervision3D] How to apply quaternions to a 3DObject
azupko at zupko.info
Sun Jul 6 23:53:24 PDT 2008
To use quaternions you simply need to multiply them back into your
objects transformation matrix. Something like this:
var rotation:Quaternion = Quaternion.createFromAxisAngle(rotAxis.x,
rotAxis.y, rotAxis.z, radians);
createFromAxisAngle simply handles the sin/cos math for you, but you
can manually set your xyzw in the constructor as well.
You only need to do a 3x3 transform since you aren't using them for
translation (if you need help with that just ask - I have been having
a serious love affair with quaternions as of late).
You can see how to use it more fully at http://blog.zupko.info/?
p=143. Check the rollMe function in the source.
hope that helps
On Jul 7, 2008, at 2:00 AM, AngelicD wrote:
> Hi, basically i just need to rotate a 3d object such as a Plane,
> using a
> quaternion, that is i have the x,y,z,w values and i need to apply it
> to the
> 3d object.
> Don't seem to be able to figure out how to apply it directly to the
> I can do rotationX, rotationY, rotationZ fine (pitch, yaw, roll) but
> directly through quaternions.
> Please Help,
> View this message in context: http://www.nabble.com/How-to-apply-quaternions-to-a-3DObject-tp18310482p18310482.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
> Papervision3D mailing list
> Papervision3D at osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Papervision3D