Six-sided shape with 2D texture coordinates for each face. More...
#include <Box.hpp>
Public Member Functions | |
Box (const Tag &tag) | |
Protected Member Functions | |
virtual void | updateBufferCoords () |
Six-sided shape with 2D texture coordinates for each face.
void updateBufferCoords | ( | ) | [protected, virtual] |
Initializes the coordinates in the vertex buffer.
The following 2D texture coordinates are stored in an array as follows.
01-----11 2-------3 | | | | | | | | 00-----10 0-------1
They are applied to the vertices in the vertex buffer as depicted in the following diagram. Numbers on the left are the indices of the vertices, while numbers on the right correspond to the positions in the texture coordinate array above.
INDICES COORDINATES +-------+ +-------+ /| /| /| /| 1-------0 | 2-------3 | FRONT | +-----|-+ | +-----|-+ |/ |/ |/ |/ 2-------3 0-------1
4-------5 3-------2 /| /| /| /| +-------+ | +-------+ | BACK | 7-----|-6 | 1-----|-0 |/ |/ |/ |/ +-------+ +-------+
9-------+ 2-------+ /| /| /| /| 8-------+ | 3-------+ | LEFT | 10----|-+ | 0-----|-+ |/ |/ |/ |/ 11------+ 1-------+
+------12 +-------3 /| /| /| /| +------13 | +-------2 | RIGHT | +-----|15 | +-----|-1 |/ |/ |/ |/ +------14 +-------0
17-----16 2-------3 /| /| /| /| 18-----19 | 0-------1 | TOP | +-----|-+ | +-----|-+ |/ |/ |/ |/ +-------+ +-------+
+-------+ +-------+ /| /| /| /| +-------+ | +-------+ | BOTTOM | 22----|23 | 0-----|-1 |/ |/ |/ |/ 21-----20 2-------3
Implements Hexahedron.