Moving Milkshape Models w/out translatef
I would like to have more control over my Milkshape Models. i cannot figure out how to access a center point on a model (x,y,z)
that i can change to change the position of my Model in OpenGL. The only thing i can figure out is to use Translatef() before my call to pModel->draw(). i believe that this will cause problems down the line, since it would be more difficult to determine collision and to move a possible 100 models in different directions simultaniosly. can anyone tell me how to find that center point and use it to move my models??
You''ll have to use translatef at some point, it just means you have to do the same when doing collision detection.
To find the centre of the model, you should just be able to do the averages of the (x,y,z) values for all the vertices.
~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
To find the centre of the model, you should just be able to do the averages of the (x,y,z) values for all the vertices.
~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement