|
@@ -3,6 +3,7 @@
|
3
|
3
|
#include <math.h>
|
4
|
4
|
#include <QDebug>
|
5
|
5
|
#include "entities/ugeentitycube.h"
|
|
6
|
+#include "entities/ugeentityaxes.h"
|
6
|
7
|
|
7
|
8
|
RenderWidget::RenderWidget(QWidget *parent) :
|
8
|
9
|
QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
|
|
@@ -17,6 +18,7 @@ RenderWidget::RenderWidget(QWidget *parent) :
|
17
|
18
|
UGEEntityCube* cube = new UGEEntityCube(_engine);
|
18
|
19
|
cube->move(Vector3D(0, 1, 0));
|
19
|
20
|
_engine->addEntity(cube);
|
|
21
|
+ _engine->addEntity(new UGEEntityAxes(_engine));
|
20
|
22
|
setMouseTracking(false);
|
21
|
23
|
setFocusPolicy(Qt::StrongFocus);
|
22
|
24
|
}
|
|
@@ -40,8 +42,6 @@ void RenderWidget::paintGL()
|
40
|
42
|
);
|
41
|
43
|
_device->lookAt(center, Vector3D(0.0f, 0.0f, 0.0f));
|
42
|
44
|
_engine->draw();
|
43
|
|
-
|
44
|
|
- drawAxes();
|
45
|
45
|
}
|
46
|
46
|
|
47
|
47
|
void RenderWidget::resizeGL(int width, int height)
|
|
@@ -110,13 +110,3 @@ void RenderWidget::rotate(float phi, float theta)
|
110
|
110
|
}
|
111
|
111
|
update();
|
112
|
112
|
}
|
113
|
|
-
|
114
|
|
-void RenderWidget::drawAxes()
|
115
|
|
-{
|
116
|
|
- _device->drawLine(ColorVector3D(Qt::red, 0.0, 0.0, 0.0), ColorVector3D(Qt::red, 1.0, 0.0, 0.0), 2.5);
|
117
|
|
- _device->drawLine(ColorVector3D(Qt::green, 0.0, 0.0, 0.0), ColorVector3D(Qt::green, 0.0, 1.0, 0.0), 2.5);
|
118
|
|
- _device->drawLine(ColorVector3D(Qt::blue, 0.0, 0.0, 0.0), ColorVector3D(Qt::blue, 0.0, 0.0, 1.0), 2.5);
|
119
|
|
-
|
120
|
|
- _device->drawPolygon(QList<ColorVector3D>() << ColorVector3D(Qt::red, 0, 0, 0) << ColorVector3D(Qt::green, 1, 0, 0) << ColorVector3D(Qt::transparent, 1, 1, 0) << ColorVector3D(Qt::blue, 0, 1, 0));
|
121
|
|
-
|
122
|
|
-}
|