Archived

This topic is now archived and is closed to further replies.

mrrolf810p

Model scaling

Recommended Posts

mrrolf810p    122
I''ve been trying to load and play with MD2 models. I have them opening and displaying just fine, except they are huge. My scene is drawn on about a 10 unit scale. (What I mean by this is something that is glTranslate3f(0.0f, 0.0f, 10.0f) is far away) The MD2 models have a huge scale, around 100 units. I''m using the code on NeHe to load the files, so I believe they are loading correctly. To scale the models down, would I need to use glScalef()? Or is there some other more eligant way? In the code I''m using it''s already scaling the vertices by the scale factor that I read in. But this isn''t doing the trick. Also I''m trying to get a bounding box for the models... so that their feet can be on the ground and such. Do I need to manually calculate this box when I load in the file? I dont'' see that info anywhere in the model file. Thanks Robbie

Share this post


Link to post
Share on other sites
_DarkWIng_    602
You can scale model down when you load it. Since vertices are stored in short int format (or is it char?) you need to multiply them by some small number. newX = float(x) * 0.001f;
Bouding boxes are simple. the easiest way of doing it is to just create an empty box then add all the vertices to it (all frames & all vertices)

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites