From fedc6e9684e017513b52f845f1c9384d738cfe62 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 26 Oct 2015 21:50:32 +0100 Subject: Add first version of drawing F with transformations --- src/glitem.cpp | 7 +++++++ src/glitem.h | 6 ++++++ src/mmscene.cpp | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/glitem.cpp b/src/glitem.cpp index 47b2acc..47e2c03 100644 --- a/src/glitem.cpp +++ b/src/glitem.cpp @@ -430,6 +430,13 @@ void GLItem::createF(double height) createCube(QVector3D(stdLength, height - 2.0 * stdLength, 0.0),QVector3D(2.0 * stdLength, height - 3.0 * stdLength, stdLength)); } +void GLItem::drawF(double height) +{ + m_renderer->scale(QVector3D(300.0, 300.0, 300.0)); + + createCube(QVector3D(0.0, 0.0, 0.0), QVector3D(1.0, 1.0, 1.0)); +} + void GLItem::createAxis(double length, const QVector3D & origin, const QVector3D & axis, const QVector3D & normal, const QVector3D & texCoord, const GLColorRgba& color) diff --git a/src/glitem.h b/src/glitem.h index 552120d..e58f36f 100644 --- a/src/glitem.h +++ b/src/glitem.h @@ -137,6 +137,12 @@ protected: */ virtual void createF(double height); + /** + * @brief drawF Draws an 'F' with matrix transformations. + * @param height The height of the 'F'. + */ + virtual void drawF(double height); + /** * @brief createAxes Creates x, y and z axis with specified length starting for (0,0,0) * @param length Axes length. diff --git a/src/mmscene.cpp b/src/mmscene.cpp index ad5ce8d..b55e8ab 100644 --- a/src/mmscene.cpp +++ b/src/mmscene.cpp @@ -33,7 +33,7 @@ void MMScene::paintOnTopOfQmlScene() void MMScene::setupGeometry() { - createF(5.0); + drawF(5.0); m_colorArrayEnabled = true; -- cgit v1.2.3-70-g09d2