ssloy / tinyrenderer

A brief computer graphics / rendering course
https://github.com/ssloy/tinyrenderer/wiki
Other
20.73k stars 1.99k forks source link

Help jumping from 2D to 3D in Lesson 1 #99

Open rwdavis3rd opened 2 years ago

rwdavis3rd commented 2 years ago

In the opening sentence of Lesson 4 we admit that the rendering we've been doing so-far is an orthographic perspective, which is rendered by simply ignoring the Z coordinate of 3D points. This would have been useful knowledge to me, back in Lesson 1, when we leapt from drawing simple 2D lines, between 2D points, to drawing a 3D wire mesh from a set of 3D coordinates, without any bridging commentary. I may be slower than most, but my reaction at that point was:

Wait! isn't he going to do some sort of projection from world coordinates to screen coordinates? 

It was after studying your rendering code that the penny dropped: that your rendering scheme, simply ditches the Z coordinate of each point. (My shallow experience with 3D graphs was just enough that I knew to label this as orthographic rendering at that point.)

My suggestion: at the moment of transition from 2D lines to wire mesh, there be some rhetoric that rendering will ignore Z for now, which will produce decent, if a bit imperfect, rendering for 3D things viewed from far-Z... just a suggestion.