Object Manipulation and Matricies

Started by Mr. Hanson, March 12, 2003, 04:40:10 PM

Previous topic - Next topic

Mr. Hanson

Ok, basicaly I'm ignorant when it comes to matricies.   :?   I'm having trouble figuring out how to manipulate my objects.  I'm trying to figure out how to translate and rotate my objects in there own object space and not world space.  Having trouble getting the order of the multiplications right.  Would be really handy having functions to make manipulation of objects a little easier.  Maybe a function similar to:  object3D.translate(float x,float y,float z,int FRAME) where frame could be WORLD or OBJECT.  The same with rotations.  If not, than more examples on how to achieve this would be helpful too.   :wink:

EgonOlsen

I don't quite understand...!? Do you want this rotation/translation to be permanent, i.e. manipulate the object after it has been loaded? If so, at least for rotations there is a way to achieve this by using the rotateMesh()-method. Just set up the rotation matrix in the way you want it to be and call rotateMesh() to execute this on the object's mesh data (don't forget to reset the rotation matrix afterwards). The bounding box needs to be recalculated afterwards, but the method already takes care of this. If this is what you want, i can add a translateMesh()-method as well. If not, please let me know...
Edit: Please keep in mind that this is intended to be done at startup, not during runtime, because it's not as cheap as "normal" transformations are.