Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Smoothing vertices of a polygon

  1. #1
    Junior Member Regular Contributor
    Join Date
    Jun 2010
    Posts
    162

    Smoothing vertices of a polygon

    I would like to smoothen the vertices of polygon. How could that be done? I just want to avoid sharp edges? Please give me some suggestions.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    185
    Quote Originally Posted by jenny_wui View Post
    I would like to smoothen the vertices of polygon. How could that be done? I just want to avoid sharp edges? Please give me some suggestions.

    Each vertex must have a normal. If your surface comes from a modeling program
    it may have vertex normals already computed for you. Otherwise you'll have to
    compute them by averaging the polygon normals sharing each vertex. Then, before
    drawing a vertex, call glNormal (.....). That's all there is to it. You must also turn
    smooth shading on using the command below...


    glShadeModel (GL_SMOOTH);


    Note: These comments apply to Fixed Pipeline GL.
    Last edited by Carmine; 01-22-2013 at 11:10 AM.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2010
    Posts
    162
    Actually I wanted to say that I have a contour (boundary) which is a connected set of vertices. It looks a bit rugged. I want to make it look a bit smooth keeping the number of vertices same, but vertex coordinates may be manipulated. How can that be done?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •