-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScene.h
61 lines (44 loc) · 1.22 KB
/
Scene.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
#ifndef _SCENE_H_
#define _SCENE_H_
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include "Camera.h"
#include "Color.h"
#include "Mesh.h"
#include "Transformation/Rotation.h"
#include "Transformation/Scaling.h"
#include "Transformation/Translation.h"
#include "Triangle.h"
#include "Vector/Vec3.h"
#include "Vector/Vec4.h"
using namespace std;
class Scene {
public:
Color backgroundColor;
bool cullingEnabled;
vector<vector<Color> > image;
vector<Camera *> cameras;
vector<Vec3 *> vertices;
vector<Color *> colorsOfVertices;
vector<Scaling *> scalings;
vector<Rotation *> rotations;
vector<Translation *> translations;
vector<Mesh *> meshes;
Camera *currentCamera;
Vec4 vec1, vec2, vec3;
Scene(const char *xmlPath);
void initializeImage(Camera *camera);
void forwardRenderingPipeline(Camera *camera);
int makeBetweenZeroAnd255(double value);
void writeImageToPPMFile(Camera *camera);
void convertPPMToPNG(string ppmFileName, int osType);
bool isBackFace() const;
bool clipLine(Vec4 &v0, Vec4 &v1);
void wireRasterization(Vec4 v0, Vec4 v1);
void solidRasterization();
};
#endif