-
Notifications
You must be signed in to change notification settings - Fork 0
/
light.h
executable file
·47 lines (37 loc) · 1.04 KB
/
light.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
/** @file include/light.h
* This file contains functions and class to define
* a light source in the scene
*/
// read the above info and make proper changes, amen
#ifndef LIGHT_H
#define LIGHT_H
#include "vector.h"
#include "surface_rendering.h"
#include "projection.h"
#include "obj_parser.h"
#include "camera.h"
class Light
{
public:
Vector_3d position;
Vector_3d fall_at;
float intensity;
Camera cam = Camera(position, fall_at, Vector_3d(0, 1, 0)); //light source as camera;
Light(Vector_3d position, Vector_3d fall_at, float intensity = 0.5)
{
this->position = position;
this->fall_at = fall_at;
this->intensity = intensity;
}
void set_position(Vector_3d pos)
{
this->position = pos;
}
void set_intensity(float intensity)
{
this->intensity = intensity;
}
};
void DrawTriangle(Vector_3d c1,Color color1,Vector_3d c2,Color color2,Vector_3d c3,Color color3);
void draw3D(Vertex Vertices[],int faces_size, Faces Faces[], Material mtl);
#endif // LIGHT_H