Post by nerdboy4200 on Feb 18, 2019 8:10:00 GMT
Hi all,
I'd like to first say that this isn't really a "I'm stuck" situation - but more of a weirdness that I wanted to bring up and see what others have done with this.
I've written 2.5 versions of the raytracer code presented in the book (pure python3, python3 + numpy (thats the 1/2), and nimlang (converted from the python version)) and have found an oddity in epsilon.
I've noticed that you have 2 values for epsilon spread across the book (b6 edition):
Now the interesting thing is that the 0.0001 is suggested for the epsilon test for floating point - but later on - you also suggest using 0.00001.
So interestingly enough - if you set both testing and regular epsilon to 0.00001 - I see these failures:
But if I set the regular epsilon to 0.00001 and testing epsilon to 0.0001 - everything is fine (which is how I leave it).
I am guessing that some of it is due to the numbers that are used for the tests - but others might be just due to odd rounding as well.
I'd love to hear other peoples thoughts on this.
I'd like to first say that this isn't really a "I'm stuck" situation - but more of a weirdness that I wanted to bring up and see what others have done with this.
I've written 2.5 versions of the raytracer code presented in the book (pure python3, python3 + numpy (thats the 1/2), and nimlang (converted from the python version)) and have found an oddity in epsilon.
I've noticed that you have 2 values for epsilon spread across the book (b6 edition):
- 0.0001 (found in XIX)
- 0.00001 (found on page 5)
Now the interesting thing is that the 0.0001 is suggested for the epsilon test for floating point - but later on - you also suggest using 0.00001.
So interestingly enough - if you set both testing and regular epsilon to 0.00001 - I see these failures:
FAIL: Scenario: The reflected color for a reflective material
* col == color(0.19032, 0.2379, 0.14274)
FAIL: Scenario: shade_hit() with a reflective material
* col == color(0.87677, 0.92436, 0.82918)
FAIL: Scenario: The refracted color with a refracted ray
* c == color(0,0.99888,0.04725)
FAIL: Scenario: Converting a normal from object to world space
* n == vector(0.2857,0.4286,-0.8571)
FAIL: Scenario: Finding the normal on a child object
* n == vector(0.2857,0.4286,-0.8571)
But if I set the regular epsilon to 0.00001 and testing epsilon to 0.0001 - everything is fine (which is how I leave it).
I am guessing that some of it is due to the numbers that are used for the tests - but others might be just due to odd rounding as well.
I'd love to hear other peoples thoughts on this.