ssloy/tinyrenderer

Why I am getting a woman version head?

qhanson opened this issue · 1 comments

As shown in this image, I finished wiki 4 using barycentric rather than line sweeping. Then I suddenly find that the output is different from the tutorial.
output

wow, I find it is related to the initialization of the zbuffer.
for(int i = 0; i <width*height; ++i ) zbuffer[i] = -std::numeric_limits<float>::max();
vs
for(int i = 0; i <width*height; ++i ) zbuffer[i] = std::numeric_limits<float>::min(); this version gives your the woman version...