-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworld.h
83 lines (56 loc) · 2.14 KB
/
world.h
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef world_h
#define world_h
//******************************************************************************//
// //
// World.h - header file for the "world" object. The world is the container //
// for the objects that are to be rendered in our 3D world. This also //
// contains the main rendering algorithm. //
// //
//******************************************************************************//
#include "light.h"
#include "point3d.h"
#include "ray.h"
#include "sphere.h"
#include "plane.h"
#include "viewplane.h"
#include "threedimensionalshape.h"
#include <math.h>
#include <vector>
using namespace std;
class World {
private:
vector<ThreeDimensionalShape*> vecShapes; //vector used to store our 3D objects
Point3d* camera; //the position of the camera (or eye)
Viewplane* viewplane; //the viewplane (or canvas) which is the window on our world.
Light* light; //our light in the world (only one light - sort of sun)
public:
World();
//
// Constructor
///////////////////////////////////////////////////////////////////////////
~World();
//
// Deconstructor
///////////////////////////////////////////////////////////////////////////
void addShape(ThreeDimensionalShape* theShape);
//
// addShape - adds a ThreeDimensionalShape to the world
///////////////////////////////////////////////////////////////////////////
void addCamera(Point3d* cam);
//
// addCamera - adds a camera - the viewpoint
///////////////////////////////////////////////////////////////////////////
void addLight(Light* l);
//
// addLight - the single light source for the world
///////////////////////////////////////////////////////////////////////////
void addViewplane(Viewplane* vp);
//
// addViewplane - the window on the world that we look through - has image stretched across it
///////////////////////////////////////////////////////////////////////////
void render();
//
// render - renders the image
///////////////////////////////////////////////////////////////////////////
};
#endif