<p>You are talking about two different planes.</p>
<p>The website is talking about the plane of the quadrilateral being rendered. It uses that plane to compute the Z for a particular X,Y point. Basically, the question being asked is, &quot;what is the Z value for the quad at this X,Y value on the screen?&quot; To compute that, you can use the plane equation for that plane, solve for Z, and plug in appropriate X, Y values.</p>
<p>This is different from the plane of perspective projection.</p>
<p>Now it should be said, this isn't how people compute the Z coordinate in perspective projection for rasterizers. The website in question is meant to explain how depth buffers work. As they require some sort of &quot;depth&quot; data, they present the simplest way to compute a Z value for a polygon as projected on a point on the screen. The depth buffer doesn't care about the exact values involved; so long as the closer values consistently have bigger or smaller values than those farther away, the depth test does what it is meant to do.</p>
<p>So do not take this as &quot;how depth is calculated&quot;. It's merely an example meant to illustrate how the depth buffer works: it's a comparative test between the incoming fragment's depth and a stored depth.</p>

CC BY-SA 4.0
2022-01-26T18:37:18.890Z
2022-01-26T18:37:18.890Z
Nicol Bolas
<p>Suppose in perspective projection <span class="math-container">$(x, y, z)$</span> coordinate projects to point <span class="math-container">$(x_p, y_p, z_{vp})$</span> in projection plane <span class="math-container">$AX+BY+CZ+D=0$</span> where projection plane kept at <span class="math-container">$z_{vp}$</span> position. And the plane <span class="math-container">$AX+BY+CZ+D=0$</span> is satisfied by every point <span class="math-container">$(x_p, y_p, z_{vp})$</span> and in whole projection plane <span class="math-container">$z_{vp}$</span> is constant.</p>
<p>Also we know that Z value(Z buffer value) for an object doesn't come from the z-value <span class="math-container">$z_{vp}$</span> of the projection plane.</p>
<p>But in many <a href="https://www-geeksforgeeks-org.cdn.ampproject.org/v/s/www.geeksforgeeks.org/z-buffer-depth-buffer-method/amp/?usqp=mq331AQKKAFQArABIIACAw%3D%3D&amp;amp_js_v=a8&amp;amp_gsa=1#referrer=https%3A%2F%2Fwww.google.com&amp;csi=0&amp;ampshare=https%3A%2F%2Fwww.geeksforgeeks.org%2Fz-buffer-depth-buffer-method%2F" rel="nofollow noreferrer">websites</a> I seen Z value(Z buffer value) is calculating by the plane equation <span class="math-container">$AX+BY+CZ+D=0$</span> of the point (x, y, z) which is the point of space point not the projection plane point. My question is why can we calculate Z value(Z buffer value) from the plane equation <span class="math-container">$AX+BY+CZ+D=0$</span> of the space point <span class="math-container">$(x, y, z)$</span> because <span class="math-container">$AX+BY+CZ+D=0$</span> is only satisfied by the point  <span class="math-container">$(x_p, y_p, z_{vp})?$</span></p>

CC BY-SA 4.0
2022-01-26T18:34:47.723Z
Your use of the plane equation with respect to projection sounds... [familar](https://computergraphics.stackexchange.com/q/12290/2654).
Nicol Bolas
CC BY-SA 4.0
2022-01-26T18:42:42.677Z
... So you're admitting that this was you. You deleted your account and created a new one so you could keep posting questions.
Nicol Bolas
<3d><projections><perspective><z-buffer>
Why we calculate z buffer value from plane equation $AX+BY+CZ+D=0$?
S. M.
# Why we calculate z buffer value from plane equation $AX+BY+CZ+D=0$?

(Asked by: username_0 on 2022-01-26)

Suppose in perspective projection $(x, y, z)$ coordinate projects to point $(x\_p, y\_p, z\_{vp})$ in projection plane $AX+BY+CZ+D=0$ where projection plane kept at $z\_{vp}$ position. And the plane $AX+BY+CZ+D=0$ is satisfied by every point $(x\_p, y\_p, z\_{vp})$ and in whole projection plane $z\_{vp}$ is constant.

Also we know that Z value(Z buffer value) for an object doesn't come from the z-value $z\_{vp}$ of the projection plane.

But in many [websites](https://www-geeksforgeeks-org.cdn.ampproject.org/v/s/www.geeksforgeeks.org/z-buffer-depth-buffer-method/amp/?usqp=mq331AQKKAFQArABIIACAw%3D%3D&amp_js_v=a8&amp_gsa=1#referrer=https%3A%2F%2Fwww.google.com&csi=0&ampshare=https%3A%2F%2Fwww.geeksforgeeks.org%2Fz-buffer-depth-buffer-method%2F) I seen Z value(Z buffer value) is calculating by the plane equation $AX+BY+CZ+D=0$ of the point (x, y, z) which is the point of space point not the projection plane point. My question is why can we calculate Z value(Z buffer value) from the plane equation $AX+BY+CZ+D=0$ of the space point $(x, y, z)$ because $AX+BY+CZ+D=0$ is only satisfied by the point $(x\_p, y\_p, z\_{vp})?$

**Tags:** 3d, projections, perspective, z-buffer

> **Comments:**
> **username_1**: Your use of the plane equation with respect to projection sounds... [familar](https://computergraphics.stackexchange.com/q/12290/2654).  
> **username_1**: ... So you're admitting that this was you. You deleted your account and created a new one so you could keep posting questions.  

---

## 1 answers

### Answer by username_1 on 2022-01-26. Score: 1 | Accepted answer

You are talking about two different planes.

The website is talking about the plane of the quadrilateral being rendered. It uses that plane to compute the Z for a particular X,Y point. Basically, the question being asked is, "what is the Z value for the quad at this X,Y value on the screen?" To compute that, you can use the plane equation for that plane, solve for Z, and plug in appropriate X, Y values.

This is different from the plane of perspective projection.

Now it should be said, this isn't how people compute the Z coordinate in perspective projection for rasterizers. The website in question is meant to explain how depth buffers work. As they require some sort of "depth" data, they present the simplest way to compute a Z value for a polygon as projected on a point on the screen. The depth buffer doesn't care about the exact values involved; so long as the closer values consistently have bigger or smaller values than those farther away, the depth test does what it is meant to do.

So do not take this as "how depth is calculated". It's merely an example meant to illustrate how the depth buffer works: it's a comparative test between the incoming fragment's depth and a stored depth.


---

