Results 1 to 4 of 4

Thread: what is the range of clipping space in OpenGL?

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    24

    Question what is the range of clipping space in OpenGL?

    I'm a beginner in opengl, and I enounter a problem concering about clipping space.
    I read from opengl 4.0 reference that Values specified by glClearDepth are clamped to the range 0 1.
    but the normilized device coordinate(NDC) has the rang [-1, 1] right?
    My question: is the value of glClearDepth applied to NDC? if it is, then how could I clip the vertex with z value between [-1, 0]?

  2. #2
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,674
    glViewport and glDepthRange define the extents of window-space, the space that comes after NDC space. The glClearDepth value is in window-space, not NDC space.

    glDepthRange in particular defines the Z mapping from the [-1, 1] range to the user-defined depth range.

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    24
    as you mentioned window-space is a 3d coord, right? I thought it was mapped from ndc and was a 2d coord.

  4. #4
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,674
    It is mapped from NDC space; NDC space is 3D as well. OpenGL never uses purely 2D coordinates for rendering. That's where the depth comes from.

Similar Threads

  1. Computing radiance in world space, object space or view space?
    By shapeare in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-25-2013, 06:22 PM
  2. Implementing clipping in 3D Space
    By SummertimeClothes in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 10-18-2012, 01:24 PM
  3. Eye vs. Clipping Space
    By dvwood in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-24-2009, 08:08 AM
  4. Clipping triangles in clip space
    By urquidio in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 02-01-2007, 10:52 AM
  5. Replies: 1
    Last Post: 09-02-2003, 01:45 PM

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