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

Thread: glClipPlane() yes, but is there such a thing as glClipSphere() ?

  1. #1
    Newbie Newbie
    Join Date
    Dec 2013
    Posts
    2

    glClipPlane() yes, but is there such a thing as glClipSphere() ?

    Using identical Bézier patches (hyperbolic paraboloids) with 12 distinct orientations, I have constructed a continuous three-dimensional surface. It is symmetrical outwards from a central point. I can take sections of the object using clipping planes, but I need to examine the structure by cutting away everything exterior to a given sphere. In other words, I would like to examine its appearance interior to and bounded by a sphere.

    Hence my question, is there such a thing in OpenGL as glClipSphere() similar to glClipPlane(), or is there a way to achieve the same end? Of course, I could specify hundreds of tangential clipping planes to a given sphere but there's got to be an easier way.

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,067
    No, there is no glClipSphere() or anything similar. But, you can make a very precise cut using vertex shader and clipping on per vertex basis. Not just a sphere, you can implement whatever you want.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Dec 2009
    Posts
    198
    Clipping a triangle by a sphere will not give you another triangle (or two) as clipping it with a plane does. You could instead use a fragment shader to discard all fragments outside the clipping sphere.

  4. #4
    Newbie Newbie
    Join Date
    Dec 2013
    Posts
    2
    Thank you, I'll try that.

Posting Permissions

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