I’m making my own 3D renderer in JS and am trying to create a z-buffer. However, I need to then get the position of each pixel on the triangles being rendered to get the distance from the camera. I can get which pixels I need to measure, but how can I find the cooridnates on the triangle?
To clarify, I’m not trying to render a triangle or find the coordinates of the vertice. I’m trying to find the position of a point on the triangle that is spread through three dimensions.