|
Post by inventordave on Jan 21, 2020 12:10:54 GMT
The image below is the output I get from attaching a hexagon() object as the only world object in my scene. My hexagon code is here: github.com/leeodea/js-raytracer-challenge/blob/master/rt.examples.js. As you can see, I tried a couple of alternative methods for calcing the inputs to the rotation_y() calls in hexagon(), to no avail... What do you think I've done wrong??
|
|
fremag
Junior Member
Posts: 73
|
Post by fremag on Jan 21, 2020 14:33:09 GMT
Hi,
In your code, the line:
var et = m_multiply(translation(0,0,1), m_multiply(rotation_y(-Math.PI/6), m_multiply(rotation_z(-Math.PI/2), scaling(0.25,1,0.25))))
Should be:
var et = m_multiply(translation(0,0,-1), m_multiply(rotation_y(-Math.PI/6), m_multiply(rotation_z(-Math.PI/2), scaling(0.25,1,0.25)))) Then I got the expected hexagon shape.
|
|
|
Post by inventordave on Jan 22, 2020 9:24:39 GMT
Gah, how silly of me. Thanks for that!
|
|
|
Post by vorpal on Jan 21, 2023 15:44:11 GMT
I really struggled with Chapter 14. My three wackys as per the YAML file Jamis posted here were a hot mess. Turns out I had made a mistake in using Bounding Boxes. I recommend you turn bounding boxes off (for groups, just set them to minpoint = -INF, -INF, -INF and maxpoint = INF, INF, INF) and see if it renders properly. At least that way, you'll be able to find which section of the code your bug is in... groups, or bounding boxes. Note: reading down, I see you got it. Congratulations! Finishing Chapter 14 was a major accomplishment for me. I'm only too happy to move on despite the utility I see in groups.
|
|