Rotation in cornell box
This commit is contained in:
12
main.cpp
12
main.cpp
@@ -252,9 +252,17 @@ void cornellBox() {
|
||||
world.add(make_shared<quad>(point3(0,0,555), vec3(555,0,0), vec3(0,555,0), white));
|
||||
|
||||
// Boxes.
|
||||
world.add(box(point3(130, 0, 65), point3(295, 165, 230), white));
|
||||
world.add(box(point3(265, 0, 295), point3(430, 330, 460), white));
|
||||
shared_ptr<hittable> box1 = box(point3(0,0,0), point3(165,330,165), 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;
|
||||
cam.aspectRatio = 1.0;
|
||||
cam.imageWidth = 600;
|
||||
|
Reference in New Issue
Block a user