void Draw()
{
AXIS axy;
int a = 0;
glBegin(GL_QUADS); /*im pretty sure its something with this line here but i dont know what to replace it with and opengl.org didnt help*/
while(Print(ngc, a, &axy))
{
glVertex3f(axy.x, axy.y, axy.z);
a++;
}
glEnd();
}
3D Model Wire is good solid is bad
I made a 3d model engine and the wire version works fine but the solid version dosnt seem to like to work. It draws this really messed up thing(shown below). The wire version draws fine(also shown below).
Can someone tell me whats wrong with the solid code?
thx nuke
There two versions are loaded from the same file it should look like a gun.
Wire version
Solid version
[edited by - nukem on June 9, 2002 2:19:21 AM]
try using GL_TRIANGLE or is it GL_TRIANGLES? instead of quads...
hmmm...looking at the pictures it could also be that you dont have your vertex's going in the correct way (i.e counterclockwise/clockwise)
[edited by - prod on June 9, 2002 2:22:20 AM]
hmmm...looking at the pictures it could also be that you dont have your vertex's going in the correct way (i.e counterclockwise/clockwise)
[edited by - prod on June 9, 2002 2:22:20 AM]
The problem is you have two concave polygons - the side of the gun. It''s an L. You need to split each L into two quads - and it really is better to use triangles rather than quads.
~CGameProgrammer( );
~CGameProgrammer( );
So your saying to draw two diffrent shapes and then connect them insted of drawing it all together as one shape? Right now it draws it all as one shape. If you think it will help I can post the coords file.
You are telling OpenGL to draw quads, which are convex four-vertex polygons. Yet the two L-sides of the gun are concave 6-vertex polygons, not quads. They are invalid geometry. You need to split those faces into two quads each.
~CGameProgrammer( );
~CGameProgrammer( );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement