Jump to content
  • Advertisement
Sign in to follow this  


This topic is 5109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi ! Let's say i have this struct(object struct)
struct Object

int numVertex;
int numFaces;
Point3f* vertices;
Point3i* faces;
Point3f* faceNormals;
Point3f* vertexNormals;

where point3i is
struct Point3i//this is in fact a face
int	i[3];

In the rendering function i call: glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(GL_FLOAT,0,glObj.logo.pObjects[0].faceNormals); glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3,GL_FLOAT,0,glObj.logo.pObjects[0].vertices); //glDrawArrays(GL_TRIANGLES,0,glObj.logo.pObjects[0].numVertex); glDrawElements(GL_TRIANGLES,0,GL_UNSIGNED_INT,glObj.logo.pObjects[0].faces); for drawing object[0] Conclusions: -it works fine using glDrawArray that i commented but the vertices are not in the correct order like any 3dMax file so i need to use indices -it doesn't work using indices ? I hope you can help me out!

Share this post

Link to post
Share on other sites
Well i almost solved the problem :
glDrawElements(GL_TRIANGLES,0,GL_UNSIGNED_INT,glObj.logo.pObjects[0].faces); 0 was the number of elements that's why it didn't work.[lol]
But know the object i loaded look different than the one rendered with glVertex .This new one is thinner than the other ,
do you know one reason why is this happening?The File is an ASE in case this matters.

Is it necessary to disableglDisableClientState after drawing every object so you can point the new locations in memory of the new vertices , indices etc or only when going back to glVertex commands

Does the disabling order matters?


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!