-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (29 loc) · 761 Bytes
/
main.cpp
File metadata and controls
40 lines (29 loc) · 761 Bytes
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
#include "defs.h"
#include <iostream>
#include "Vector2.h"
#include "Vector3.h"
#include "Vector4.h"
#include "Razterizer.h"
#include "Matrix44.h"
#include "GenMath.h"
int main(void){
initscr();
raw();
noecho();
Razterizer razterizer(WW, WH);
float angle = 0;
Matrix44 transformation;
transformation.scale(Vector3(4, 2, 1));
transformation.rotate(Vector3(0, 0, 1), GenMath::toRadians(20));
Vector4 v1(10, 10, 1, 1);
Vector4 v2(20, 10, 1, 1);
Vector4 v3(15, 20, 1, 1);
v1 = transformation * v1;
v2 = transformation * v2;
v3 = transformation * v3;
razterizer.razterizeTriangle(Vector2(v1.x, v1.y), Vector2(v2.x, v2.y), Vector2(v3.x, v3.y));
getch();
clear();
endwin();
return 0;
}