Results 1 to 9 of 9

Thread: Jagged Polygon Edges

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    7

    Jagged Polygon Edges

    I am trying to display a 3D cube or other similar entity. I noticed that the top face of the cube (in an isometric type view) is being displayed with a jagged edge through which I can see a portion of the polygon making up the back face(s). I have enabled GL_POLYGON_SMOOTH, but that doesn't seem to work. Does anyone know how to fix this problem so that I don't get conflicts along corners of my 3D objects?

  2. #2
    Member Newbie
    Join Date
    Aug 2003
    Location
    asda
    Posts
    47

    Re: Jagged Polygon Edges

    Have you tried to call glHint also? http://msdn.microsoft.com/library/de...unc03_9uno.asp

    My guess is that you will get antialiasing but that it will be very slow. If you have a newer card with full screen anti aliasing, FSAA, will that probably be a better idea.
    asd

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2002
    Posts
    9

    Re: Jagged Polygon Edges

    I think this is because of the z fighting between the back facing polygon and the front facing. You can do back face culling - glEnable(GL_CULL_FACE) or decrease the far view plane distance to get more accurate z buffering - gluPerspective(.......).
    doing back face culling will also increase the rendering speed.

    [This message has been edited by ctoa (edited 07-19-2003).]

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Jagged Polygon Edges


  5. #5
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Westerville, Oh, USA
    Posts
    201

    Re: Jagged Polygon Edges

    Okay, I'm about to show my "beginner" status again, but what the heck...I'm a beginner. I'm working on a simulation of Jupiter and it's four major moons. I draw everything in the XY-plane and then effectively rotate the entire scene with gluLookAt() by using an up vector of (0, 0, 1), so I get an "edge-on" view of the system. So, if I want to sort my objects back-to-front using their Z-values to help with anti-aliasing, I'm really using my objects' Y-values since they're all in the XY-plane, right? Or for Z-buffer purposes, is my Y-axis acting as the Z-axis because of the gluLookAt() rotation?

    FYI, the reason I draw in the XY-plane as opposed to the XZ-plane is because in a separate viewport, I render a 2-D miniature "heads-up" view of the planet/moon system using gluOrtho2D, GL_POINTS, and glVertex2d(), to which I simply pass the x and y coordinates of each object.

  6. #6
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Jagged Polygon Edges

    Drawing order sorting is not done in object but screen coordinates.
    You need to apply the modelview and projection matrix to the polygons and sort by resulting z.
    Polygon smoothing is a weird feature. I would recommend to try full scene antialiasing (FSAA) or multisampling instead.
    FSAA is just a flick of a switch in your vendor's control panel, you just render your scene as usual, easy as that.
    Multisampling needs to be selected via WGL_ARB extensions pixelformat and multisample.

    [This message has been edited by Relic (edited 07-21-2003).]

  7. #7
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Westerville, Oh, USA
    Posts
    201

    Re: Jagged Polygon Edges

    FSAA did the trick. Is there a way to set this in software, similar to the way waiting for vsync is set and unset?

  8. #8
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Jagged Polygon Edges

    Yes, if supported by your OpenGL implementation with the extensions in my last sentence from above.
    See http://oss.sgi.com/projects/ogl-sample/registry/ for the specs. You might to look up some examples on the developer pages of your graphics vendor.

  9. #9
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Westerville, Oh, USA
    Posts
    201

    Re: Jagged Polygon Edges

    Thanks, Relic. I think it's time I learned about the OpenGL extension mechanism. I've been using the basic API up until now.

Similar Threads

  1. Weird jagged edges / precision problems
    By Jippie in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-12-2018, 02:58 PM
  2. Polygon edges
    By c0de in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-19-2007, 03:42 PM
  3. How to eliminate jagged edges ?
    By TanjuOZgur in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-07-2006, 05:56 AM
  4. rendered model edges are jagged
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-18-2004, 04:28 AM
  5. Bad jagged edges on all objects
    By grnbriar in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-15-2004, 11:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean