|
Post by sbphillips on Sept 3, 2021 22:34:42 GMT
I am trying to recreate the table image at the front of the cubes chapter. The table and the cubes on the table seem to render okay but the pattern on the left wall does not show up. the floor and the right wall render fine. I've attached an image of the walls by themselves. Any ideas?
|
|
|
Post by Jamis on Sept 4, 2021 3:45:56 GMT
I suspect you need to rotate the pattern on the left wall around the y axis by 90 degrees. Right now, the stripes are just slices along the x-axis, and I'll bet the left wall is simply parallel to one of those slices. If you rotate the pattern around the y axis by 90 degrees, the pattern will be perpendicular to that wall, and will manifest as you expect.
|
|
|
Post by sbphillips on Sept 4, 2021 4:36:32 GMT
I would think the same thing, but this is the walls cube section from table.yml and I don't believe it's rotated.
# walls
- add: cube
transform:
- [ scale, 10, 10, 10 ]
material:
pattern:
type: checkers
colors:
- [ 0.4863, 0.3765, 0.2941 ]
- [ 0.3725, 0.2902, 0.2275 ]
transform:
- [ scale, 0.05, 20, 0.05 ]
ambient: 0.1
diffuse: 0.7
specular: 0.9
shininess: 300
reflective: 0.1
|
|
|
Post by inventordave on Sept 8, 2021 11:34:56 GMT
Is there any chance there is an erronous manual transformation of the Patten at the class/instantiation level, and it is rotated 90deg, just in the correct manner for the right wall? Maybe your implementation simply renders the Pattern on, say, the yx-plane, but the left wall is on the yz-plane?
EDIT: It just occured to me, because it's been a long time since I peeked into the Pattern code, but my answer is probably nonsense, as the Pattern should render on the face of the Plane, based on {u,v} normalized co-ordinates, if that's so, then without any transformation of the pattern, it should by default render appropriately. Sorry, lol. I hope you've figured it out!
|
|
|
Post by Jamis on Sept 8, 2021 15:28:53 GMT
Ah, I'd forgotten I described that using a checker pattern! So yes, forget what I said. Are you rendering the YAML file from forum.raytracerchallenge.com/post/13/thread, without any changes? If so, I wonder if your checker pattern is failing to scale correctly. It's almost like it's scaling y and z correctly, but scaling x by 20 instead of 0.05...
|
|
|
Post by sbphillips on Sept 8, 2021 20:55:08 GMT
Like I mentioned, the left wall doesn't render stripes correctly. Everything else seems to render okay.
|
|
|
Post by sbphillips on Jan 24, 2022 21:22:55 GMT
for some unknown reason I looked at this today. Apparently I didn't read the YAML file and your previous comment to well. I saw stripes so I used stripes and not checkered. Works fine now
|
|