Rotation in cornell box

This commit is contained in:
CJSatnarine
2024-07-11 10:09:15 -04:00
parent 359f8a9108
commit 5203ed3e17
4 changed files with 341475 additions and 341467 deletions

Binary file not shown.

682928
image.ppm

File diff suppressed because it is too large Load Diff

View File

@@ -252,9 +252,17 @@ void cornellBox() {
world.add(make_shared<quad>(point3(0,0,555), vec3(555,0,0), vec3(0,555,0), white)); world.add(make_shared<quad>(point3(0,0,555), vec3(555,0,0), vec3(0,555,0), white));
// Boxes. // Boxes.
world.add(box(point3(130, 0, 65), point3(295, 165, 230), white)); shared_ptr<hittable> box1 = box(point3(0,0,0), point3(165,330,165), white);
world.add(box(point3(265, 0, 295), point3(430, 330, 460), white)); box1 = make_shared<rotateY>(box1, 15);
box1 = make_shared<translate>(box1, vec3(265,0,295));
world.add(box1);
shared_ptr<hittable> box2 = box(point3(0,0,0), point3(165,165,165), white);
box2 = make_shared<rotateY>(box2, -18);
box2 = make_shared<translate>(box2, vec3(130,0,65));
world.add(box2);
// Camera.
camera cam; camera cam;
cam.aspectRatio = 1.0; cam.aspectRatio = 1.0;
cam.imageWidth = 600; cam.imageWidth = 600;