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
|