Archived

This topic is now archived and is closed to further replies.

Nukem

3D Model Wire is good solid is bad

Recommended Posts

Nukem    118
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
    
  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();
  }
    
[edited by - nukem on June 9, 2002 2:19:21 AM]

Share this post


Link to post
Share on other sites
Prod    134
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]

Share this post


Link to post
Share on other sites
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( );

Share this post


Link to post
Share on other sites
Nukem    118
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.

Share this post


Link to post
Share on other sites
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( );

Share this post


Link to post
Share on other sites