This repository was archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (48 loc) · 1.56 KB
/
main.cpp
File metadata and controls
64 lines (48 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "Vector3D.h"
#include "ColorRGB.h"
#include "Ray.h"
#include "SceneObject.h"
#include "Plane.h"
#include "Sphere.h"
#include "Scene3D.h"
#include "Camera.h"
#include "Light.h"
#include <iostream>
using namespace std;
int main() {
float w,x,y,z;
std::cin >> w >> x >> y >> z;
Plane p(ColorRGB(1,0,1), 0, Vector3D(0,1,0),w);
Sphere s1(ColorRGB(1,0,0), .5, Vector3D(-1.2,.5,0),x);
Sphere s2(ColorRGB(0,1,0), .5, Vector3D(0,.5,0),y);
Sphere s3(ColorRGB(1,.5,.7), .5, Vector3D(1.2,.5,0),z);
Light l1(Vector3D(-10,10,5), ColorRGB(.8,.8,.8));
Light l2(Vector3D(5,3,5), ColorRGB(.3,.3,.3));
Camera c(Vector3D(-1.5,1,3), Vector3D(-.3,.5,0));
Scene3D scene;
scene.add_object(&s1);
scene.add_object(&s2);
scene.add_object(&s3);
scene.add_object(&p);
scene.add_light(&l1);
scene.add_light(&l2);
scene.render(c, 10000, std::cout);
/*Plane p(ColorRGB(.7,.7,.7), 0, Vector3D(1,0,0),1);
Sphere s1(ColorRGB(1,.3,0), .5, Vector3D(1,0,0),1);
Sphere s2(ColorRGB(.2,1,.4), .5, Vector3D(1,1,1),1);
Sphere s3(ColorRGB(1,.7,0), .5, Vector3D(1,-1,-1),1);
//Sphere s3(ColorRGB(0,0,1), .5, Vector3D(1.2,.5,0));
//Sphere s4(ColorRGB(.5,.5,0), .25, Vector3D(-.5,.25,0));
Light l1(Vector3D(5,0,0), ColorRGB(.7,.7,.7));
Light l2(Vector3D(0,5,0), ColorRGB(.3,.3,.3));
Camera c(Vector3D(3.75,-1,-.75), Vector3D(0,0,0)-Vector3D(3.75,-1,-.7));
Scene3D scene;
scene.add_object(&s1);
scene.add_object(&s2);
scene.add_object(&s3);
//scene.add_object(&s4);
scene.add_object(&p);
scene.add_light(&l1);
scene.add_light(&l2);
scene.render(c, 2000, std::cout);*/
}