diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-10-20 12:37:03 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-10-20 12:37:03 +0200 |
| commit | d08bef1ccd33b9f2600e84dfe30545c2abc1b180 (patch) | |
| tree | 52e4d57f597368d282df6d23c32d854d25c0b9ab | |
| parent | d738e0bf45c6d9503d5d9549d8e54b313a9276d0 (diff) | |
| download | Multimedia-d08bef1ccd33b9f2600e84dfe30545c2abc1b180.tar.gz Multimedia-d08bef1ccd33b9f2600e84dfe30545c2abc1b180.zip | |
Create createF function
| -rw-r--r-- | src/glitem.cpp | 10 | ||||
| -rw-r--r-- | src/glitem.h | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/glitem.cpp b/src/glitem.cpp index a307e38..47b2acc 100644 --- a/src/glitem.cpp +++ b/src/glitem.cpp @@ -362,7 +362,7 @@ void GLItem::createCube(const QVector3D &lbb, const QVector3D &rtf) // Create all the vectors for caching QVector3D lbf = QVector3D(lbb.x(), lbb.y(), rtf.z()); QVector3D rbb = QVector3D(rtf.x(), lbb.y(), lbb.z()); - QVector3D rbf = QVector3D(rtf.x(), lbb.y(), rtf.y()); + QVector3D rbf = QVector3D(rtf.x(), lbb.y(), rtf.z()); QVector3D ltb = QVector3D(lbb.x(), rtf.y(), lbb.z()); QVector3D ltf = QVector3D(lbb.x(), rtf.y(), rtf.z()); QVector3D rtb = QVector3D(rtf.x(), rtf.y(), lbb.z()); @@ -422,6 +422,14 @@ void GLItem::createCube(const QVector3D &lbb, const QVector3D &rtf) m_points.append(GLPoint(ltf, n0, t0, GLColorRgba::clGreen)); } +void GLItem::createF(double height) +{ + float stdLength = height/5.0; + createCube(QVector3D(0.0, 0.0, 0.0),QVector3D(stdLength, height, stdLength)); + createCube(QVector3D(stdLength, height, 0.0),QVector3D(3.0 * stdLength, height - 1.0 * stdLength, stdLength)); + createCube(QVector3D(stdLength, height - 2.0 * stdLength, 0.0),QVector3D(2.0 * stdLength, height - 3.0 * stdLength, stdLength)); +} + 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 5e60ee6..552120d 100644 --- a/src/glitem.h +++ b/src/glitem.h @@ -132,6 +132,12 @@ protected: virtual void createCube(const QVector3D &lbb, const QVector3D &rtf); /** + * @brief createF Creates an 'F' with cubes. + * @param height The height of the 'F'. + */ + virtual void createF(double height); + + /** * @brief createAxes Creates x, y and z axis with specified length starting for (0,0,0) * @param length Axes length. */ |
