dp
New Member
Posts: 4
|
Post by dp on Oct 27, 2022 1:21:34 GMT
Hi, I am stuck at the end of chapter 7. The test "Constructing a ray when the camera is transformed" is failing because the result I get for the ray direction is: (- sqr2/2, 0, - sqr2/2) (note the x is negative) All the other tests in that section are passing. And when I render the scene at the end of chapter 7 I get an inversion and 2 scenes. I checked my code but obviously I missed something any help to see where I need to look closer ? thanks. Attachments:
|
|
dp
New Member
Posts: 4
|
Post by dp on Nov 11, 2022 5:54:38 GMT
I moved along continuing with the book but I finally found my issue. x and y swapped and bad memory allocation. (looks like I might have some issue with the cone though) Attachments:
|
|
|
Post by paj006 on Mar 15, 2023 4:14:11 GMT
I have the exact same issue. Where exactly were x, y switched? I have been trying to switch them in different places but then I get 'no index' errors. EDIT it was in the 'toPPM' function. You have to loop height first, then columns. This passes the chapter 2 test because the test 'image' is symmetrical - the pixel is in the exact center. Thus, looping column first gets the same result as looping row first. And to make things worse, the pixel in the middle uses a symmetrical RGB value! SUGGESTION: Change the chapter 2 test so the green pixel is not in the exact middle.
|
|