-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.6 - Reflections #63
Comments
Hi, I suggest you test if the reflected ray does occur by adding a condition before you compute Best, |
I thought that I already checked that the reflected ray occurs by checking that |
Hi, I tried running in perspective and I do not get any reflections. I followed the same logic outlined above (and mentioned in office hours). I have: When I use perspective, my code takes an incredibly long time to terminate (still running after 30 minutes in release mode!) |
Hi, As a debugging advice, if you do not see the reflection, you should go into your code, find the line that computes it. Then add multiple printing codes there to see what is going on, i.e. what everything's value is. And then you may be able to identify if it's the problem with the intersection, or shading model, etc. And if the program is running long, it's always good to add a lot of intermediate printings so that you can be sure that your program is actually running and what is the current state, instead of going into some infinite loop caused by some bug. Best, |
I'm currently working on implementing section 1.6 of the homework for reflections. I conceptually understand how it works, but implementing it with my code is proving to be difficult.
I currently have a for loop iterating through all objects in the scene to test for intersections with the meshes. I thought that, along with testing for mesh intersections, this is where I would check for mirror intersections. I have set my mirror as
y = -1
, and in every iteration of the for loop I solve fort
in the equatione_y + t * d_y = -1
to see ift > 0
, meaning the ray cast from the camera intersected with the mirror. I then construct vectorsr
andd
per the instructions in the textbook, and perform ray intersection onr
to get the pixel value assign in my color matrix.Unfortunately, my output image is exactly the same, with no reflections rendered at all. Is my algorithm flawed or is my thinking correct? My code is updated in my repo in a function called
part4
.The text was updated successfully, but these errors were encountered: