-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglWidget.cpp
More file actions
42 lines (32 loc) · 1.36 KB
/
glWidget.cpp
File metadata and controls
42 lines (32 loc) · 1.36 KB
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
#include "glWidget.h"
namespace RubicsCube {
MainScene::MainScene() : scene() {
scene.setGeometry(30,30,1400,1200);
scene.setWindowTitle("Rubic's Cube with GLSL [LucianDeveloper & Andromagin]");
ShaderObject *tmp = (ShaderObject*) new Cube(0, QVector3D(0, 0, 0));
scene << tmp;
tmp = (ShaderObject*) new Room(1, QVector3D(0, 1, 0));
scene << tmp;
tmp = (ShaderObject*) new Sky(2, QVector3D(0, 1, 0));
scene << tmp;
tmp = (ShaderObject*) new Floor(3, QVector3D(0, 1, 0));
scene << tmp;
Lamp* newLamp = new Lamp(2, QVector3D(5, 3.5, 5), QVector3D(0.0, 0.0, 0.7), 0.3);
newLamp->light.setLa(QVector3D(0.03, 0.03, 0.05));
newLamp->light.setLd(QVector3D(0.1, 0.1, 0.5));
scene << newLamp->getLight();
scene << (ShaderObject*) newLamp;
newLamp = new Lamp(2, QVector3D(-5, 3.5, -5), QVector3D(0.7, 0.0, 0.0), 0.3);
newLamp->light.setLa(QVector3D(0.05, 0.03, 0.03));
newLamp->light.setLd(QVector3D(0.5, 0.1, 0.1));
scene << newLamp->getLight();
scene << (ShaderObject*) newLamp;
newLamp = new Lamp(2, QVector3D(-5, 3.5, 5), QVector3D(0.0, 0.7, 0.0), 0.3);
newLamp->light.setLa(QVector3D(0.03, 0.05, 0.03));
newLamp->light.setLd(QVector3D(0.1, 0.5, 0.1));
scene << newLamp->getLight();
scene << (ShaderObject*) newLamp;
}
MainScene::~MainScene() {}
void MainScene::start() { scene.show(); }
}