Scan-Line Z-Buffering Dilemma
Posted
by
Belgin
on Game Development
See other posts from Game Development
or by Belgin
Published on 2012-10-14T13:25:47Z
Indexed on
2012/10/14
15:51 UTC
Read the original article
Hit count: 250
I have a set of vertices in 3D space, and for each I retain the following information:
- Its 3D coordinates (x, y, z).
- A list of pointers to some of the other vertices with which it's connected by edges.
Right now, I'm doing perspective projection with the projecting plane being XY and the eye placed somewhere at (0, 0, d), with d < 0. By doing Z-Buffering, I need to find the depth of the point of a polygon (they're all planar) which corresponds to a certain pixel on the screen so I can hide the surfaces that are not visible. My questions are the following:
How do I determine to which polygon does a pixel belong to so I could use the formula of the plane which contains the polygon to find the Z-coordinate?
Are my data structures correct? Do I need to store something else entirely in order for this to work?
I'm just projecting the vertices onto the projection plane and joining them with lines based on the pointer lists.
© Game Development or respective owner