Post by ransom on Mar 8, 2021 18:05:34 GMT
Hi,
I've been following the book as a project to introduce me to rust, and it's been going great so far.
However, I've come into a problem in chapter 7. All my tests are passing and I'm at the "bringing it together" stage, trying to render the scene on page 105.
The 2 problems I'm running into are:
1. The floor (added in step one of page 106) is covering up the entire image.
However, I've come into a problem in chapter 7. All my tests are passing and I'm at the "bringing it together" stage, trying to render the scene on page 105.
The 2 problems I'm running into are:
1. The floor (added in step one of page 106) is covering up the entire image.
2. Removing the floor renders the image, but it looks like the spheres are higher than expected, and the spheres that should be towards the front are towards the back instead.
The following images of the outputs show these problems (EDIT: the forum doesn't seem to like embedding them, converted to links):
These problems lead me to suspect that my camera view transformation is wrong.
The output of my view_transform function with the inputs on page 107:
The output of my view_transform function with the inputs on page 107:
from = point(0.0, 1.5, -5.0),
to = point( 0.0, 1.0, 0.0)
up = vector(0.0, 1.0, 0.0)
is the following matrix [x][y]
Matrix { contents: [[-0.9950371902099892, 0.0, 0.0, 0.0], [0.0, 0.9900990099009901, 0.09900990099009901, -0.9900990099009901], [0.0, 0.09950371902099892, -0.9950371902099892, -5.1244415295814445], [0.0, 0.0, 0.0, 1.0]] }
This was used to render the above scenes
If anyone's got some working code, could you possibly test yours and see if your outputs to view_transform match that output, so I can see if that's a problem with my view_transform or another function? Does anyone have any other ideas of places to look for bugs.
My code is here: github.com/RansomTime/Raytracer-challenge-book/releases/tag/chapter-7 - please excuse the inelegance of some of it.