Jump to content
  • Advertisement


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


Model scaling

This topic is 5754 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!