Loading multiple 3ds objects.

Hey guys,

I am wondering what is the best and easiest way to load multiple objects in VC++. (Convert from 3DS to OpenGl??) If I have a number of small objects, like a tree, stool and bird as seperate objects, and I want to place them in my world on different angles, distances etc…

I’m confused, any help is appreciated!

Thanks,
Tripharn

[This message has been edited by tripharn (edited 05-04-2003).]

Hi !

You can save the current transformation with:
glPushMatrix();
and restore it with:
glPopMatrix();

Make sure you have selected the modelview matrix first.

So you would do something like this:
glPushMatrix();
glTranslate(…);
draw first object
glPopMatrix();
glPushMatrix();
glTranslate();
draw second object
glPopMatrix();

And so on…
you can of course also use glRotate and glScale.

Mikael

Check out Display3DS for a simple example (one mesh).

Loading multiple meshes could be as easy as making an array of mesh objects, including translation and rotation info per mesh, and displaying them all in your paint routine by stepping through the mesh array using code similar to the previous poster.