The Ray Tracer Challenge: "Computing the normal on a transformed sphere" ebook test

I don’t think that you’re right about this. Mine passes all tests with the z-axis rotation in. It also passes without, but that actually makes sense. First, we would rotate the original point into world space. We would then find the vector and then rotate it back to world space, causing it to point in the same direction as before. Without the rotation, we just don’t do and then undo the rotation. The rotation in this test does pretty much nothing because we already have the intersection point. It would be very different (in later chapters) when we cast a ray from world space in a direction to intersect the sphere. Then, it will make quite a bit of difference.

Please correct me if my logic is off, and I have not done the math by hand to verify all of this, but it makes logical sense to me. And my tests are passing without making any changes like you recommend.

1 Like