graphics - How can I calculate the Z value of triangles? -


i trying implement z-buffer (depth buffer) polygon rasterization algorithm. of polygons triangles , understand 3 points (x,y,z) make triangle form plane. if have (x,y,z) values of verices, how calculate depth of every position on face of triangle?

in opengl or webgl z-buffer applied after rasterization i.e. each pixel, not each vertex of triangle. in case need save z-value each pixel , pixel max z-value. done automatically in pipeline.

if wanna calculate z-buffer vertices need own algorithm. example getting max z-value of triangle's vertices , sort triangles value.

also check link more info.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -