I have problem with insert multiple object. I load object but they are all in one place,
for( int i = 0; i <= 5; i++ )
{
glCallList( OBJECT_LIST[ i ] );
}
glFlush();
glutSwapBuffers();
} // unopened paren
void Reshape( int width, int height ) {
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
for( int i = 0; i <= 5; i++ ) {
if( !load_obj( argv[ i ], OBJECT_LIST[ i ] ) )
{
printf( "error load file %s", argv[ i ] );
}
}
}
you need to either specify object matrix directly (as if loading objects from a 3DS file) like this:
Looking at this, also note you can't store matrix operations in display lists (ie. if your load_obj() function is setting up matrices anyhow, it won't work because these operations are not "recorded").
The other option is to use some simple object positioning scheme, such as this:
Either way, you need to write some extra functions (pointer_to_object_matrix or object_[x, y, z, yaw, pitch and roll]). If you are just looking to display some objects, try this:
Hope it helps ...