3D Model Wire is good solid is bad

Started by
4 comments, last by Nukem 21 years, 10 months ago
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]
--------------------------Nukemmsn: nukem996@hotmail.comaim: nukem996open source open mind
Advertisement
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]
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( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
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.
--------------------------Nukemmsn: nukem996@hotmail.comaim: nukem996open source open mind
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( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
thx
--------------------------Nukemmsn: nukem996@hotmail.comaim: nukem996open source open mind

This topic is closed to new replies.

Advertisement