diff options
Diffstat (limited to 'src/drone_controller.cc')
-rw-r--r-- | src/drone_controller.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/drone_controller.cc b/src/drone_controller.cc index 9a6c5db..fc1cefe 100644 --- a/src/drone_controller.cc +++ b/src/drone_controller.cc @@ -26,8 +26,6 @@ Drone::Drone() { if (!mesh_initialized) { QVector<GLfloat> verts = load_obj(":/mdl/dji600.obj", LOAD_OBJ_NORMALS | LOAD_OBJ_UVS); QOpenGLTexture *texture = new QOpenGLTexture(QImage(":/img/dji600.jpg").mirrored()); - // texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear); - // texture->setMagnificationFilter(QOpenGLTexture::Linear); mesh = new OpenGLMesh(verts, texture); mesh_initialized = true; } @@ -92,13 +90,16 @@ DroneController::DroneController(const QJsonObject &json) OpenGLWidget::instance->makeCurrent(); QOpenGLTexture *ground_tex = new QOpenGLTexture(QImage(":/img/ground.jpg").mirrored()); + ground_tex->setMagnificationFilter(QOpenGLTexture::LinearMipMapLinear); + ground_tex->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear); + ground_tex->setWrapMode(QOpenGLTexture::MirroredRepeat); OpenGLMesh *ground = new OpenGLMesh({ - -100, 0, -100, 0, 1, 0, 0, 0, - 100, 0, -100, 0, 1, 0, 1, 0, - -100, 0, 100, 0, 1, 0, 0, 1, - 100, 0, -100, 0, 1, 0, 1, 0, - -100, 0, 100, 0, 1, 0, 0, 1, - 100, 0, 100, 0, 1, 0, 1, 1, + -1000, 0, -1000, 0, 1000, 0, 0, 0, + 1000, 0, -1000, 0, 1000, 0, 1000, 0, + -1000, 0, 1000, 0, 1000, 0, 0, 1000, + 1000, 0, -1000, 0, 1000, 0, 1000, 0, + -1000, 0, 1000, 0, 1000, 0, 0, 1000, + 1000, 0, 1000, 0, 1000, 0, 1000, 1000, }, ground_tex); OpenGLWidget::instance->meshes.append(*ground); OpenGLWidget::instance->doneCurrent(); |