karansher / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
0 stars 0 forks source link

Getting flipped image #34

Open SHaiderX opened 2 years ago

SHaiderX commented 2 years ago

The output image of the sphere im getting seems to be rotated. image

I used the precompiled binaries for the A2 code. Anyone have this problem or know how to solve it?

MicheleMassa802 commented 2 years ago

I remember when I was doing the last assignment, this happened and I had to swap the i and j coordinates in the viewing ray function (use j to build u, use i to build v), so now that this is happening to you with the precompiled files my guess is that maybe the code that calls those functions is the one thats wrong (not the precompiled implementation), having accidentally swapped the i and j coordinates. I'd say try to find wherever viewing ray is called and swap the i and j ints and try that. No matter what happens the output you have looks correct (just flipped lol), so for the sake of marking of this assignment, your src files should be ok. Im not a TA tho, so dont take my answer for a fact.

panuelosj commented 2 years ago

Yeah, it's likely because of an inconsistency with how you're treating the ray i,j coordinates between the precompiled binaries and your newly written code.