GLM beginning

Hi…I am new to opengl and glut…

below is the piece of code to import and display an object titled f-16.obj…the code compiles and an empty window appears but the object doesnot load.Can u tell me what i am doing wrong.


main(int argc, char** argv)
GLMmodel* pmodel = NULL;
int models;

glutInitWindowSize(600, 600);
glutInit(&argc, argv);


//printf(“Here i Am!!!”);
pmodel = glmReadOBJ(“f-16.obj”);
//if (!pmodel) exit(0);
glmVertexNormals(pmodel, 90.0);

glmDraw(pmodel, GLM_SMOOTH | GLM_MATERIAL);


My guess is that your camera is not set to be able to view the model. What is the parameter of gluPerspective or glFrustum you give. Take care of znear and zfar. Do you use gluLookAt? Blank screen happen often when these parameter are incorrect.

Try to draw a simple geometry like a triangle around the origin and adjust your projection matrix and modelview matrix to be able to see it.

I don’t use glut but to be able to view something you should at least use

glViewport and (gluPerspective or glFrustum or glOrtho, etc)
for setting the projection matrix

gluLookAt or (glTranslate,glRotate) to modify the modelview matrix but these are not obligatory.

Try to find tutorial for learning how to set the projection and the modelview matrix correctly.

hope it help.