Rotation For Models

Topics: User Forum
Feb 21, 2007 at 6:38 AM
Edited Feb 21, 2007 at 6:42 AM
I have some models to add to my octtree, but I use quaternions for rotations. How can I convert these to the Vector3 the octtree wants? Also, how can I later change the rotation? I have tons of asteroids that all move and rotate, but it seems like I can only update the positions. And scale? Why is the only dynamically alterable property position? My asteroids move, rotate, and can be various sizes (from the same Model). The scale can also change if I break one into multiple little ones.
Feb 28, 2007 at 3:52 AM
The components you derrive from the OcttreeGameComponent class can have any properties you want. The only ones that are required by the Octtree are the Position and the Bounding Sphere. These are needed for the Octtree to place your component into the proper node (sector) so that the draw method is called at the proper time (when visible).

I would suggest that you derrive a base class from the OcttreeGameComponent that contains properties that are common to your needs. This will allow it (your base class) to handle quaternion rotations, etc.....

If you are adding asteriods that move and rotate, then you should make them OcttreeGameComponent's and not just models (that was really there for static objects). updating the Position of an OcttreeModelInfo type is useful for placing a "dead" static ojbect somewhere else (if even needed). You might have static models that can still be blown out of the sky (space?).

Did this help?