hoppermagic

08 Jan 2007 : Ship viewer

This code was adapted from an excellent article at Macromedia explaining how to rotate a 3D object using Quaternions. Whilst being too complex to fully grasp the key thing about quaternions is they can be multiplied together to create a composite quaternion and supposedly require fewer calculations than with matricies. Apparently the camera positions in early Tomb Raider games are calculated using them.

I modified the code to add in my Cobra model (no easy task) and whilst I could rotate it using quaternions, I couldn't find a way to translate (move) it. There seems to be a bit of a debate as to whether quaternions are more efficient than matrix maths (Papervision didnt initially support them), however with matricies I'm on slightly firmer ground so I decided I would use matrix rotations from now on.

Leave a comment