|
Post by inventordave on Jun 4, 2020 16:19:53 GMT
Hi, I've gotten my javascript raytracer to quite a good point, and it can now produce my reference image, as seen here: Observe, the Earth and Moon are between us and the origin, so the texture maps are rendered such that we see the "backside" of the Earth and Moon, which means, for the Earth, we see mainly ocean, and Australia. So, I applied rotation_y() to the sphere's 'transform' matrix, but it yielded no change, so I thought maybe I should rotate the Pattern. Again, no change. All my tests have passed as I've gone, and transforms of scale and position work as intended (the image wouldn't exist otherwise). Anyone who feels inclined to help me identify the problem, it'd be much appreciated. The codebase can be found at github.com/leeodea/rt-dt/. To reproduce the scene, and thus the problem, open "raytracer.html" in your browser, then go to "File->Load PPM File", and load sequentially the 3 .ppm files "2k_moon.ppm", "earth.ppm" and "bgImage2.ppm". THEN, select "Options->Select/Unselect BG Image" and choose "bgImage2.ppm" from the drop-down box. Then, click the system() button on the right. Accidentally clicking "earth()", will produce a different image. So you know, the "system()" function is at the bottom of the "rt.examples.js" file. You can see I've already tried to apply rotations to both the spheres and their patterns. The other transform operations work as intended. (The code for the various types of transform are in "rt.matrix-transform.js" I'd really appreciate it if anyone can tell me why the spheres/patterns aren't rotating. Thanks.
|
|
|
Post by inventordave on Jun 4, 2020 19:53:15 GMT
Scrap that. All I had to do was apply the rotation transform last. Still check it out if you want.
|
|