PDA

View Full Version : Loading multiple 3ds objects.



tripharn
05-04-2003, 07:47 PM
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).]

mikael_aronsson
05-04-2003, 09:51 PM
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

ppinter1
05-05-2003, 06:44 AM
Check out Display3DS (http://p-squared.com/Display3DS.php) 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.