ssloy / tinyrenderer

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

Lesson 5 suggestion #96

Open Buzzefall opened 2 years ago

Buzzefall commented 2 years ago

I've found a bit confusing the fact that at master branch in triangle(..) there is bc_clip argument which is assuming we have already performed clipping. But the course Wiki says it is projection that helps us to clip vertices. And in the code we see Projection applied to bc_clip (already clipped?) vertices. Maybe I miss something..

But I think it may be useful to note that if we know parameter r=1/D where D is screen-plane-to-camera distance and planes Z=0, Z=farthest_distance, we can clip vertices before applying Projection matrix and that will bring meaning to bc_clip argument name.

What do you think?