Just playing around
This commit is contained in:
Binary file not shown.
BIN
build/Raytracer
BIN
build/Raytracer
Binary file not shown.
27
main.cpp
27
main.cpp
@@ -121,8 +121,30 @@ void earth(void) {
|
|||||||
cam.render(hittableList(globe));
|
cam.render(hittableList(globe));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void funny() {
|
||||||
|
auto texture = make_shared<imageTexture>("face.png");
|
||||||
|
auto surface = make_shared<lambertian>(texture);
|
||||||
|
auto object = make_shared<sphere>(point3(0, 0, 0), 2, surface);
|
||||||
|
|
||||||
|
camera cam;
|
||||||
|
|
||||||
|
cam.aspectRatio = 16.0 / 9.0;
|
||||||
|
cam.imageWidth = 800;
|
||||||
|
cam.samplesPerPixel = 100;
|
||||||
|
cam.maxDepth = 50;
|
||||||
|
|
||||||
|
cam.vFieldOfView = 20;
|
||||||
|
cam.lookFrom = point3(0,0,12);
|
||||||
|
cam.lookAt = point3(0,0,0);
|
||||||
|
cam.vUp = vec3(0,1,0);
|
||||||
|
|
||||||
|
cam.defocusAngle = 0;
|
||||||
|
|
||||||
|
cam.render(hittableList(object));
|
||||||
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
int sceneToShow = 3;
|
int sceneToShow = 4;
|
||||||
|
|
||||||
switch (sceneToShow) {
|
switch (sceneToShow) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -134,5 +156,8 @@ int main(void) {
|
|||||||
case 3:
|
case 3:
|
||||||
earth();
|
earth();
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
funny();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user