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 5 of 5

Thread: Please Help Me about Curving the Faces of a World Mesh.

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2018
    Posts
    8

    Please Help Me about Curving the Faces of a World Mesh.

    I am using C++ and am looking to the future. I plan to have each two triangles making up a quad class in a world of quads. For now, I am not considering the best ways to render the triangles. I am using the new OpenGL. Each of these two triangles will share the same angled face. As I am understanding, now, the physics will work well with linear interpolation that will allow a ball to be placed correctly anywhere on the combined faces. However, I would like to make the faces of each quad curved, or smoothed, or averaged with there neighbors, not angular. I believe this is called splining. So, how can I easily draw curves between faces instead of angles? If they can be drawn with an (easy) spline method, I believe related calculations can be made to place an object anywhere on them!

    Thank you so much for your help,

    Josheir
    Last edited by Josheir; 01-06-2019 at 01:45 PM.

  2. #2
    Member Regular Contributor
    Join Date
    May 2016
    Posts
    476
    for smooth shading of say a ball, you dont need any splines, instead vertex normals interpolated over the face (triangle, quad, whatever) can be used ...

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2018
    Posts
    8
    John_connor, I researched what you suggested and I'm uncertain If I am communicating correctly. What I'm saying is if the faces of the quads are angled steeply where they meet than it would be very angular. I would like it to look more like a curved hump. It seems to me that this would need more than just smooth shading, or am I wrong?

    Thanks again,

    Josheir

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2018
    Posts
    8

    Attachment to Explain.

    I have attached a drawing. It's the edge of three faces (they aren't little). Does smooth shading make the blue angles become the red curve? What if it were made up of only two blue edges?

    Thank you!

    Josheir

    Edit: All edges are same size.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	image1.gif 
Views:	1 
Size:	5.6 KB 
ID:	2940  
    Last edited by Josheir; 01-06-2019 at 04:49 PM.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,067
    Quote Originally Posted by Josheir View Post
    I have attached a drawing. It's the edge of three faces (they aren't little). Does smooth shading make the blue angles become the red curve?
    No, it just makes it harder for the eye to tell the difference. See the images at the top of this page for an example. It won't affect the object's silhouette, though.

    Ultimately, the hardware renders triangles. Smooth surfaces are usually implemented using a piecewise-linear approximation, with the number of subdivisions determined by a combination of what's acceptable and what the hardware can handle at a reasonable speed. This can be done in the application or (possibly) in the hardware.

    Legacy (1.x) OpenGL supports Bézier curves and patches via what it terms evaluators. The GLU library uses these to implement NURBS curves and surfaces. These typically aren't implemented in hardware.

    This feature isn't supported in modern OpenGL (3.1+ core profile). However, OpenGL 4.0+ supports a more general mechanism via tessellation shaders.

Tags for this Thread

Posting Permissions

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