Skip to main content
GameDev.net gamedev.net
🔒 Locked

problem drawing 3d model

Started by FreJa Oct 19, 2008 at 8:39 AM 2 replies 700+ views
Original Post
FreJa
FreJa
Hi, I'm trying to draw a .obj 3d model, however, it's not working very well: Does anyone have any idea of what could be wrong? Thanks!
"Through me the road to the city of desolation,Through me the road to sorrows diuturnal,Through me the road among the lost creation."
Funkyjive
Funkyjive
Looks like you are only drawing about a third of the triangles. When you are drawing are you sure the method you are using is the correct one? For example: If you are using GL_TRIANGLES instead of GL_TRIANGLE_STRIP or something of the sort, then your models information may be misinterpreted when rendering. Are you using a loop with glBegin/glEnd or are you using vertex arrays? Can we see the code for the drawing?

Thanks
"I would rather be in the boat with a drink on the rocks, than in the drink with a boat on the rocks" -Unknown
FreJa
FreJa
Quote:
Original post by Funkyjive
Looks like you are only drawing about a third of the triangles. When you are drawing are you sure the method you are using is the correct one? For example: If you are using GL_TRIANGLES instead of GL_TRIANGLE_STRIP or something of the sort, then your models information may be misinterpreted when rendering. Are you using a loop with glBegin/glEnd or are you using vertex arrays? Can we see the code for the drawing?

Thanks


Here's my drawing code:

glPushMatrix();glBegin(GL_TRIANGLES);for(int i=0; i<_numFaces; i++){				for(int j=0; j<3; j++)	{		vertex_s& v = _verts[_faces._vertIndex[j]];		glVertex3f(v._position[0], v._position[1], v._position[2]);	}			}glEnd();glPopMatrix();


Thanks again!
"Through me the road to the city of desolation,Through me the road to sorrows diuturnal,Through me the road among the lost creation."
mmakrzem
mmakrzem
How was the model generated? Is it possible that some of your triangles are getting culled because their back faces are pointing to the camera? Turn back face culling off to see if all the triangles show up.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.