a lot of work on th map-creator
This commit is contained in:
@@ -21,6 +21,8 @@ MapView3D::MapView3D(QWidget *parent) : QGLWidget(parent) {
|
||||
scale.y = 0.05f;
|
||||
scale.z = 0.05f;
|
||||
|
||||
gridRenderer = new GridRenderer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -40,10 +42,10 @@ void MapView3D::initializeGL() {
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_LIGHT1);
|
||||
//glEnable(GL_LIGHT1);
|
||||
|
||||
GLfloat light0_position [] = {+5, 5, +5, 1};
|
||||
GLfloat light1_position [] = {-5, 5, -5, 1};
|
||||
GLfloat light0_position [] = {+50, 50, +50, 1};
|
||||
GLfloat light1_position [] = {-50, 50, -50, 1};
|
||||
|
||||
glLightfv ( GL_LIGHT0, GL_POSITION, light0_position );
|
||||
glLightfv ( GL_LIGHT1, GL_POSITION, light1_position );
|
||||
@@ -75,8 +77,6 @@ void MapView3D::paintGL() {
|
||||
|
||||
glLoadIdentity();
|
||||
|
||||
|
||||
|
||||
// 3) scale
|
||||
glScalef(scale.x, scale.y, scale.z);
|
||||
|
||||
@@ -180,8 +180,7 @@ void MapView3D::draw() {
|
||||
if (gridModel) {
|
||||
|
||||
// show grid
|
||||
GridRenderer renderer(gridModel->getGrid());
|
||||
renderer.paintGL();
|
||||
gridRenderer->paintGL(gridModel->getGrid());
|
||||
|
||||
} else {
|
||||
|
||||
@@ -189,6 +188,7 @@ void MapView3D::draw() {
|
||||
for (MapModelElement* el : getModel()->getVisibleElements()) {
|
||||
if (el->getMV3D()) {el->getMV3D()->paintGL();}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user