From: Bruce S. <Bru...@nc...> - 2005-12-23 15:23:22
|
I think there's a typo in the definition of +y. It should be +x = object.axis.norm() +z = object.axis.cross( object.up).norm() +y = -x.cross( +z) (implicitly orthonormal to x and z) Bruce Sherwood Jonathan Brandmeyer wrote: >On Thu, 2005-12-22 at 22:38 -0500, Jeremy Sachs wrote: > > >>Hi again. I'm very confused by the methods you can use to rotate an >>object, specifically a frame. >> >> > >Hopefully this explanation will help. > >VPython uses 2 vectors to specify the orientation of its objects: axis >and up. The coordinate system of the local reference frame (for any >object, including frame objects) is defined such that > >+x = object.axis.norm() >+z = object.axis.cross( object.up).norm() >+y = +x.cross( +z) (implicitly orthonormal to x and z) > >Another way to say this, is that +y is always coplanar to axis and up, >orthogonal to axis, such that +y.diff_angle( up ) <= 90 (in degrees) > > > >>I made this model spaceship that I want to animate, such that the ship >>is always pointed in the direction that it's moving. The objects that >>make up the ship are grouped together in a frame, so that >>repositioning and rotating the model is a simpler process. The idea is >>to derive all the necessary information from one vector, called >>"dndt", that represents the velocity of the ship. That way, if I want >>to edit the path of the ship, the code that rotates the ship won't >>break. I've fiddled with the "axis" property of the frame object, and >>have just gotten really confused. >> >> >>My program is a big mess, so I made a smaller example file, which is >>at http://homepage.mac.com/rezmason/spaceship.py . It's very basic, >>and you can use it however you wish. >> >> >>Thanks, >>-JS >> >> > > > >------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >_______________________________________________ >Visualpython-users mailing list >Vis...@li... >https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |