<p>You are running on a few false assumptions here. Whoeever told you that <em>&quot;x, y, z are all in range [-1...1]&quot;</em> for clip coordinates was wrong, or explained it badly, or was misunderstood.</p>
<p>First of all, the <strong>clip coordinates can have <em>all kinds</em> of values</strong>. Afterall, they resulted from putting your whatever-natured objects through the transformation pipeline. The <em>NDC coordinates</em> of <em>all visible</em> points will be in the [-1,1] range. And that is where clipping comes into play, the operation that the &quot;clip space&quot; takes its name from. Clipping is when you <strong>cut your primitives</strong> (i.e. triangles and lines, technically also points, but practically you either cull these or not) so that they are <strong>inside the viewing volume</strong>, which in clip space means coordinates not in [-1,1], but <strong>[-w,w]</strong>.</p>
<p>Sounds weird to have a different interval for each point and what is this 4D space anyway? Well, that's what makes clipping a bit complicated. You can't just cut lines and triangles to the viewing volume in 3D, as for perspective trtansformations that might result in things behind the camera being shown or lines crossing from front to back and all kinds of weird stuff. Really, though, I leave explaining the mathematics of 4D projective space and homogenous coordinates to a proper learning resource with cool pictures. The bottom line is, <strong>you need to clip primitives in 4D homogenous space for them to behave properly under perspective projection</strong>. And that is what clip space is for.</p>
<p>After clipping, all cordinates are within the [-w,w] range and in NDC space, after dividing by w and thus realizing any actual perspective distortion, all coordinates are within [-1,1] and ready for the viewport transformation.</p>
<p>Why clip space (and thus also NDC space) is left-handed is a bit of a question of taste and tradition, based on the fact that OpenGL's depth buffer uses 1 for the back and 0 for the front. But nowadays you can pretty much change this up to your liking anyway.</p>

CC BY-SA 4.0
2022-06-10T11:56:03.617Z
2022-06-10T11:56:03.617Z
Christian Rau
<p>I'm confused about what orthographic projection matrix outputs. Based on what I know so far, orthographic projection matrix converts vertexes in eye coordinates into clip coordinates. But what exactly are clip coordinates? What are its bounds of x, y, z values? I read somewhere that its x, y, z are all in range [-1...1]. Is it true? Also, how and why axes are orientated in clip coordinates? right handed (z goes out of page) or left handed (z goes into page)? What are main differences between clip coordinates and normalized device coordinates?</p>
<p>Edit: I think the primary difference between clip coordinates and NDC is that NDC can be obtained by dividing clip coordinates by w (ie. <span class="math-container">$x_{ndc}=x_{clip}/w$</span>, <span class="math-container">$y_{ndc}=y_{clip}/w$</span>, and <span class="math-container">$z_{ndc}=z_{clip}/w$</span>. But what I don’t understand here is that even though clip coordinates x,y,z values obtained by projection matrix are in range [-1...1], is it still necessary to divide them by w to get NDC?</p>

CC BY-SA 4.0
2022-05-23T09:30:34.723Z
http://www.songho.ca/opengl/gl_projectionmatrix.html#ortho 
http://www.songho.ca/opengl/gl_transform.html
https://learnopengl.com/Getting-started/Coordinate-Systems
lightxbulb
CC BY-SA 4.0
2022-05-23T19:26:32.723Z
@lightxbulb I already read these pages but they still didn't answer some of my questions like why coordinates are left handed in NDC and is it still necessary to homogenize vertexes after passing them in projection matrix (which produces values in range -1 to 1)
Jimmy Yang
CC BY-SA 4.0
2022-05-23T21:46:02.247Z
The left vs right handed thing differs between APIs. The clip coordinates resulting from the projection matrix do not have to be in  [-1,1].
lightxbulb
<opengl><projections><coordinates>
Understanding orthographic projection matrix clip coordinates
Jimmy Yang
# Understanding orthographic projection matrix clip coordinates

(Asked by: username_0 on 2022-05-23)

I'm confused about what orthographic projection matrix outputs. Based on what I know so far, orthographic projection matrix converts vertexes in eye coordinates into clip coordinates. But what exactly are clip coordinates? What are its bounds of x, y, z values? I read somewhere that its x, y, z are all in range [-1...1]. Is it true? Also, how and why axes are orientated in clip coordinates? right handed (z goes out of page) or left handed (z goes into page)? What are main differences between clip coordinates and normalized device coordinates?

Edit: I think the primary difference between clip coordinates and NDC is that NDC can be obtained by dividing clip coordinates by w (ie. $x\_{ndc}=x\_{clip}/w$, $y\_{ndc}=y\_{clip}/w$, and $z\_{ndc}=z\_{clip}/w$. But what I don’t understand here is that even though clip coordinates x,y,z values obtained by projection matrix are in range [-1...1], is it still necessary to divide them by w to get NDC?

**Tags:** opengl, projections, coordinates

> **Comments:**
> **username_1**: http://www.songho.ca/opengl/gl_projectionmatrix.html#ortho  http://www.songho.ca/opengl/gl_transform.html https://learnopengl.com/Getting-started/Coordinate-Systems  
> **username_0**: @username_1 I already read these pages but they still didn't answer some of my questions like why coordinates are left handed in NDC and is it still necessary to homogenize vertexes after passing them in projection matrix (which produces values in range -1 to 1)  
> **username_1**: The left vs right handed thing differs between APIs. The clip coordinates resulting from the projection matrix do not have to be in  [-1,1].  

---

## 1 answers

### Answer by username_2 on 2022-06-10. Score: 1 | Accepted answer

You are running on a few false assumptions here. Whoeever told you that *"x, y, z are all in range [-1...1]"* for clip coordinates was wrong, or explained it badly, or was misunderstood.

First of all, the **clip coordinates can have *all kinds* of values**. Afterall, they resulted from putting your whatever-natured objects through the transformation pipeline. The *NDC coordinates* of *all visible* points will be in the [-1,1] range. And that is where clipping comes into play, the operation that the "clip space" takes its name from. Clipping is when you **cut your primitives** (i.e. triangles and lines, technically also points, but practically you either cull these or not) so that they are **inside the viewing volume**, which in clip space means coordinates not in [-1,1], but **[-w,w]**.

Sounds weird to have a different interval for each point and what is this 4D space anyway? Well, that's what makes clipping a bit complicated. You can't just cut lines and triangles to the viewing volume in 3D, as for perspective trtansformations that might result in things behind the camera being shown or lines crossing from front to back and all kinds of weird stuff. Really, though, I leave explaining the mathematics of 4D projective space and homogenous coordinates to a proper learning resource with cool pictures. The bottom line is, **you need to clip primitives in 4D homogenous space for them to behave properly under perspective projection**. And that is what clip space is for.

After clipping, all cordinates are within the [-w,w] range and in NDC space, after dividing by w and thus realizing any actual perspective distortion, all coordinates are within [-1,1] and ready for the viewport transformation.

Why clip space (and thus also NDC space) is left-handed is a bit of a question of taste and tradition, based on the fact that OpenGL's depth buffer uses 1 for the back and 0 for the front. But nowadays you can pretty much change this up to your liking anyway.


---

