Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!lll-winken!arisia!sgi!shinobu!odin!krypton!gavin From: gavin@krypton.sgi.com (Gavin A. Bell) Newsgroups: comp.graphics Subject: Re: 3D Animation Source Code Wanted Keywords: 3D animation C code wireframe Message-ID: <2389@odin.SGI.COM> Date: 3 Jan 90 18:43:24 GMT References: <9170@cbmvax.commodore.com> <21550@mimsy.umd.edu> <21561@mimsy.umd.edu> <21562@mimsy.umd.edu> <9182@cbmvax.commodore.com> <1990Jan2.224220.4136@ux1.cso.uiuc.edu> <1920@tellab5.TELLABS.COM> Sender: news@odin.SGI.COM Lines: 32 fayne@tellab5.TELLABS.COM (Jeffrey Fayne) writes: >The biggest problem I'm having is that all the rotation texts I've seen >assume that the rotations are based on the viewers viewpoint and not the >objects (ie. I can rotate an object (say an airplane with the nose >pointing away from the viewer) and apply rotations (yaw, roll and pitch) >... Yaw, roll, pitch isn't a very good way of representing rotations; it has been likened to representing points on the surface of the earth in a cartesian coordinate system, instead of the natural spherical coordinate system (you can do it, it just makes the math big and hairy and hard to deal with). A much better way is to use what are variously called 'Quaternions' or 'Euler paramaters' (yaw/pitch/roll is a set of 'Euler angles'; not the same as Euler paramaters). They are easy to put into a rotation matrix and are fairly easy to keep numerically stable (important if you will go through several thousand or million incremental rotations). See these references for more info: Shoemake, Ken, "Animating Rotation with Quaternion Curves," _Computer Graphics_, 19(3), 245-254, SIGGRAPH Conference Proceedings, July 1985. -- has a very nice bibliography. Kane, Thomas R., Likins, Peter W. and Levinson, David A., _Spacecraft Dynamics_, McGraw-Hill, Inc. (1983). -- quite straightforward, it is easy to adapt the formulas given to working code. --gavin