orbiting a craft around a planet 2004-01-26 - By Thomas Williams
Back use model.rotate rather than setting transform.rotation
flipping, in my experience, comes from using Euler rotation. Whne one uses transform.rotation, you are using euler rotation. Node.rotate uses quaternions (i believe this is the case) and thus avoids flipouts. Flipping out is usually the dreaded gimbal lock, which results when one attempts to set rotation on more than one axis. Using Euler transform.rotation, the rotations cannot be done simulataneously, but must be done sequentially, and thus it is possible to rotate the node in such a way that one axis lines up with the other and so when the 3d engine attempts to rotate the next axis, nothing happens cos the axes are lined up, or locked. btw, a gimbal is a gyroscope and gimbal lock was first encountered by the apollo missions to the moon in the 60s.
another possible solution is to use the axisangle. This allows you to avoid having to use sequencial rotations, as one rotates around a single arbitrary axis, not an axis based on world or local xyz. This effectively avoids sequential rotations, but one must determine the axis of rotation to use, which can be challenging.
hth
Thomas
> -- --Original Message-- -- > From: dir3d-l-bounces@(protected) > [mailto:dir3d-l-bounces@(protected)]On Behalf Of Allen > Partridge > Sent: Monday, January 26, 2004 5:56 PM > To: dir3d-l@(protected) > Subject: [Dir3d-l] orbiting a craft around a planet > > > We've been playing around with a new project that involves orbiting a > craft around a giant sphere -and eventually all sorts of other things > around that sphere (planet). > > We are of course running into all sorts of y flipping to xz problems - > I'm wondering if anyone has done any substantial work on a project that > involved objects flying/floating/camera tracking etc. around a sphere. > > --thoughts? > > > --al > > __ ____ ____ ____ ____ ____ ____ ____ ____ ____ > Dir3d-l mailing list > Dir3d-l@(protected) > http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l >
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|