1
votes

Currently i am working on the Z-buffer.I have the idea of original plane(in the world), and i process out screen vertices through: world to camera transformation, x_projection = x(world) / -z(world) (similar for y) now i am unable to find out, how i am supposed to get all the z values within the projected triangular plane on the screen.

information i have : coordinates in world space, normals in the world space, coordinates in camera space, coordinates on the 2d plane

1

1 Answers

0
votes

OpenGL ? WebGL ? shader ? interested in doing it the hard way ? which is a noble path to understand the basics ... just want to step into 3D graphics ? ... answer to your question depends on these slants ... I got into webgl from teaching myself opengl which I picked up after writing a flight simulator doing it all by hand the hard way (no 3rd party library calls at all other than to draw line segments)

Typically you rely on library calls for such low level issues and concentrate instead on defining your 3D objects and their motion/morphs over time

Sounds like you want perspective projection (distance objects appear smaller) which is the default projection flavor in both OpenGL and WebGL

let us know your intent and we can suggest further options ... welcome aboard !!!