|
Post by stevenschronk on Nov 21, 2021 23:13:52 GMT
I am having some issues getting refraction to work correctly. In my version, all of the tests pass and I have added some extra tests to prove out a few suspect areas. One clarification that would help is in my hit method, do I need to keep the negative t intersections? I am filtering them out in line 118. Tried removing the filter and it did not resolve the issue. In my version of the book the pseudo code for prepare_computations was split on two different pages. Not sure if the if and for statements are nested properly. That starts on line 1044. github.com/steven-schronk/RayTracerThanks for any help you can provide. Attachments:
|
|
|
Post by stevenschronk on Nov 23, 2021 3:05:50 GMT
Tonight I made a small change that seems to help. I was comparing the addresses of two different data structures instead of the shape pointer.
One hint that would be very helpful: Do I need to keep the negative t intersections in the hit function?
|
|
|
Post by Jamis on Nov 23, 2021 23:18:33 GMT
Hey stevenschronk, On page 67, there's a note titled "Why do I have to keep all the intersections?" It explains a bit about why you *do*, in fact, need to keep the negative intersections around (hint: it's so that you can detect when an intersection is inside a shape). I hope that helps! - Jamis
|
|
|
Post by stevenschronk on Nov 27, 2021 18:22:29 GMT
When I got my book, I thought that something might be wrong. The cover is not printed correctly and some of the printing seems off a bit.
Are you sure you mean page 67 for this note, "Why do I have to keep all the intersections"? That entry appears on page 65 of my book.
Would you please double check? That could explain why I have been having so many problems. I wonder if I have a copy of the draft of the book or something...
Thanks.
|
|
|
Post by Jamis on Nov 30, 2021 0:01:31 GMT
No, you're right, it's page 65. I was looking at a PDF, and it was apparently one of the beta versions. I'm sorry your copy is wonky, though. What specific issues have you noticed? It might be something to take up with support@pragprog.com (though I'm not sure what all they'll be able to do).
|
|