The QGLCube class represents the geometry of simple six-sided cube in 3D space. More...
#include <QGLCube>This class was introduced in Qt3D 4.8.
| QGLCube ( qreal size = 1.0f ) | |
| void | setSize ( qreal size ) |
| qreal | size () const |
| QGLBuilder & | operator<< ( QGLBuilder & builder, const QGLCube & cube ) |
The QGLCube class represents the geometry of simple six-sided cube in 3D space.
The following example adds a cube of 2 units on a side to a geometry builder, and draws it at (10, 25, 0) in a QGLPainter:
QGLBuilder list; list.newSection(QGL::Faceted); list << QGLCube(2); painter->translate(10, 25, 0); list.draw(painter);
QGLCube will create a default set of texture coordinates that shows the same texture of all six faces.
Constructs the geometry for a regular cube of size units on a side.
Sets the size of this cube.
See also size().
Returns the size of this cube.
See also setSize().
Builds the geometry for cube within the specified geometry builder.
This operator specifies the positions, and 2D texture co-ordinates for all of the vertices that make up the cube. Normals will be calculated by the builder, depending on its current section's smoothing setting.