-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
44 lines (37 loc) · 1.35 KB
/
main.cpp
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
#include "graytracer.h"
#include <QApplication>
#include "glog.h"
#include "gmathutils.h"
#include "gutils.h"
using namespace GMath;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
std::cout << "Test Code" << std::endl;
// test code
mat4f trs;
trs.rows[0] = {2.f, 0.f, 0.f, 10.f};
trs.rows[1] = {0.f, 3.f, 0.f, 20.f};
trs.rows[2] = {0.f, 0.f, 4.f, 30.f};
trs.rows[3] = {0.f, 0.f, 0.f, 1.f};
mat4f mpos, mrotation, mscale;
vec3f pos, rotation, scale;
GMathUtils::DecomposeMatrix(trs, mpos, mrotation, mscale);
GMathUtils::DecomposeMatrix(trs, pos, rotation, scale);
auto rot = GMathUtils::RotationMatrix(vec3f(0,1,0), vec3f(0.5,0.5,0));
auto v0 = rot.transpose() * vec3f(0,1,0);
auto v1 = rot.transpose() * vec3f(-1,0,0);
std::cout << "v0: " << v0 << std::endl;
std::cout << "v1: " << v1 << std::endl;
//std::cout << trs << std::endl;
//std::cout << "mpos : \n" << mpos << std::endl;
//std::cout << "mrot : \n" << mrotation << std::endl;
//std::cout << "mscl : \n" << mscale << std::endl;
//std::cout << "pos : " << pos << std::endl;
//std::cout << "rot : " << rotation << std::endl;
//std::cout << "scl : " << scale << std::endl << std::endl;
GLog::LogInfo("proj path = ", GUtils::GetProjRootPath());
GRaytracer w;
w.show();
return a.exec();
}