dilevin / computer-graphics-ray-casting

Computer Graphics Assignment about Ray Casting
2 stars 7 forks source link

Inside-a-sphere depth and normal not as expected #81

Open MariaMa-GitHub opened 1 week ago

MariaMa-GitHub commented 1 week ago

Hi,

The output that I get when running the program for inside-a-sphere.json is not as expected:

Screenshot 1 Screenshot

I have tried all the other .json files, including bunny.json, and they work perfectly. That's why I am a little confused as to why this is not working properly and don't quite understand where the problem lies (I thought it may be the interaction part but the other ones worked fine so I am not sure).

Is anyone having the same problem?

Thank you.

panuelosj commented 1 week ago

Did you check to make sure you're clipping against min_t?

MariaMa-GitHub commented 1 week ago

Did you check to make sure you're clipping against min_t?

Yes I did, in all the files where min_t is found.

Cryptidx commented 1 week ago

I am also having this same issue.

LindaWang7 commented 1 week ago

I am also having this same issue.

panuelosj commented 1 week ago

Could one of you send your code (that is working for all other examples except for this) to the ta email and I can take a look at what could be missing?

MariaMa-GitHub commented 1 week ago

Could one of you send your code (that is working for all other examples except for this) to the ta email and I can take a look at what could be missing?

I just did.

panuelosj commented 1 week ago

Remember that computing ray.origin+ray.direction should land exactly ON the image plane. This is relevant because the parametric distance t should be parametric relative to the image plane (where t=1 lands on the image plane). Consider what happens if you normalize ray.direction (and should you be doing this?)

MariaMa-GitHub commented 1 week ago

Remember that computing ray.origin+ray.direction should land exactly ON the image plane. This is relevant because the parametric distance t should be parametric relative to the image plane (where t=1 lands on the image plane). Consider what happens if you normalize ray.direction (and should you be doing this?)

Oh thank you so much! I realized I forgot to change back one of the things I wrote when I was still experimenting, and later only checked and messed around with other files and never went back to viewing_ray.

MariaMa-GitHub commented 1 week ago

For anyonw having the same issue, for me it had to do with the most basic calculation of ray.direction (my bad I never went back to check this).