karansher / computer-graphics-ray-casting

Computer Graphics Assignment about Ray Casting
1 stars 0 forks source link

Bunny being gray #39

Open yi1z opened 1 year ago

yi1z commented 1 year ago

image Anyone encounters this problem?

Y-blok commented 1 year ago

Also have this problem currently. Have not been able to figure out the issue yet.

Y-blok commented 1 year ago

I fixed my issue and I believe it was with the returned n in Triangle.cpp.

crELu commented 1 year ago

I had this same issue too, and my other two files seem to give the correct output. What helped you find the solution? I have stared at the calculation for n in Triangle.cpp but it seems correct. (I got the formula from https://www.khronos.org/opengl/wiki/Calculating_a_Surface_Normal)

Y-blok commented 1 year ago

Issue #14 helped with my solution. Hopefully, it will be something similar for you.

crELu commented 1 year ago

Thanks, I didn't think we needed to normalize since when I did that for the sphere, it messed things up.

yi1z commented 1 year ago

Issue #14 helped with my solution. Hopefully, it will be something similar for you.

Thx man this really helps!!