I am using xcode with glut, OpenGL and c++ and I am trying to import and draw a model. I have used an obj to .h file conversion and this is a small part of the header so you can see the structure.
unsigned int M4GunNumVerts = 37812;
GLfloat M4GunVerts [] = {
// f 1/1/1 1582/2/1 4733/3/1
{0.266494348503772, 0.0252334302709736, -0.000725898139236535},
{0.265592372987502, 0.0157389511523397, -0.000725898139236535},
{0.264890836474847, 0.0182004476109518, -0.00775888079925833},
I have tried to draw this in my main with this code.
glVertexPointer(3, GL_FLOAT, 0, M4GunVerts);
glNormalPointer(GL_FLOAT, 0, M4GunNormals);
glTexCoordPointer(2, GL_FLOAT, 0, M4GunTexCoords);
glDrawArrays(GL_TRIANGLES, 0, M4GunNumVerts);
When I run I cant see the model. I have set up a glut window and have made a triangle to see if shapes were being drawn and the triangle showed up. I don't know how fix this so I can see the model.
Here is the reshape function
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0, 0, w, h);
gluPerspective(45, ratio, 0.01, 1000);
glMatrixMode(GL_MODELVIEW);
Can anybody help?