Problem loading more than one 3d model in openGL


I am doing this project in openGL which uses milkshape model.
my problem is that I cann’t seem to load more than 1 model at the same time…

The project written in C# (all the openGL functions are modiffied from c++ to fit c#, and I know there’s no problem there) and it uses a MilkshapeModel class.

Here is a sample of the drawing code:

GL.glTranslatef(0.17f, 0.75f, 0f);
GL.glScaled(0.015, 0.015, 0.015);
GL.glTranslatef(-0.17f, -0.75f, 0f);

GL.glTranslatef(0.17f, 0.75f, 0f);
GL.glScaled(0.015, 0.015, 0.015);
GL.glTranslatef(-0.17f, -0.75f, 0f);

In the constructor I did:

fig1 = King(@“King1.MS3D”);
fig2 = King(@“King2.MS3D”);

King is a class inherited from MilkshapeModel class.

I think may be there is some think that writes to the same place and prevents me from loading the two models together, because echo one separately loads fine…

I’ll be glad for some help


I’m not sure what your problem is because you say you can’t load more than one model but then you list OpenGL rendering code???

what i meant the first model is display in the window and the second not… as far as i check both are loaded d created as an object

Your problem is that between rendering each model you need to use glpushmatrix and glpopmatrix to preserve the current modelview matrix.