![]() |
Vis 2 Demo
1.0
Technical illustration type real-time rendering of geometry
|
This class produces a cube that rotates around the y-axis. More...
Public Member Functions | |
SpinningCube (glm::mat4 _modelMatrix, Shader *_shader) | |
Constructor. More... | |
virtual | ~SpinningCube () |
Destructor. More... | |
virtual void | update (double _deltaT) |
Update function, called every frame. More... | |
virtual void | updateMm (glm::mat4 &_newModelMatrix) |
Function for moving the cube in world space. More... | |
virtual void | draw (glm::mat4 &_projectionMatrix) |
Draw function, called every frame. More... | |
![]() | |
GeometricObject (glm::mat4 _modelMatrix, Shader *_shader, const float *_positions_Ptr, const unsigned int _pos_size, const float *_normals_Ptr, const unsigned int _norm_size, const unsigned int *_index_Ptr, const unsigned int _ind_size) | |
Constructor. More... | |
virtual | ~GeometricObject () |
Destructor. More... | |
![]() | |
DrawableObject (glm::mat4 &_modelMatrix) | |
Constructor. More... | |
virtual | ~DrawableObject () |
Destructor. More... | |
Private Member Functions | |
SpinningCube (const SpinningCube &) | |
Hidden copy-constructor. More... | |
Static Private Attributes | |
static const float | generic_positions [CUBE_VERTEX_COUNT *3] |
the vertex positions for a generic cube with pivot in (0,0,0) and edge length 2 More... | |
static const float | generic_normlas [CUBE_VERTEX_COUNT *3] |
the vertex normals for the generic cube with pivot in (0,0,0) and edge length 2 More... | |
static const unsigned int | generic_indices [CUBE_INDEX_COUNT] |
the face indices for the generic cube with pivot in (0,0,0) and edge length 2 More... | |
Additional Inherited Members | |
![]() | |
unsigned int | index_count |
nr of polygons to be drawn More... | |
GLuint | vao_handle |
handle to the vertex attribute object More... | |
GLuint | position_buffer_handle |
handle to the vertex buffer object containing the vertex coordinates in object space More... | |
GLuint | normal_buffer_handle |
handle to the normal buffer object containing the vertex normals in object space More... | |
GLuint | index_buffer_handle |
handle to the vertex buffer object containing the face indices for each polygon More... | |
Shader * | shader_Ptr |
is a pointer to the shader this object uses More... | |
This class produces a cube that rotates around the y-axis.
This class is well suited for testing the basic setup of an OpenGL application.
Definition at line 13 of file SpinningCube.h.
SpinningCube::SpinningCube | ( | glm::mat4 | _modelMatrix, |
vis2::Shader * | _shader | ||
) |
Constructor.
[in] | _modelMatrix | is the model matrix that places the object in the world coordinate system, |
[in] | _shader | is the shader program used by this object. The geometry description is contained within the class. |
Definition at line 5 of file SpinningCube.cpp.
|
virtual |
Destructor.
Definition at line 17 of file SpinningCube.cpp.
|
private |
Hidden copy-constructor.
|
virtual |
Draw function, called every frame.
Calls its parent's draw function.
Reimplemented from vis2::GeometricObject.
Definition at line 34 of file SpinningCube.cpp.
|
virtual |
Update function, called every frame.
[in] | _deltaT | is the duration of the last frame in seconds. The cube rotates around its vertical axis. |
Implements vis2::GeometricObject.
Definition at line 21 of file SpinningCube.cpp.
|
virtual |
Function for moving the cube in world space.
[in] | _newModelMatrix | is the new model matrix to replace the old one. |
Definition at line 29 of file SpinningCube.cpp.
|
staticprivate |
the face indices for the generic cube with pivot in (0,0,0) and edge length 2
Definition at line 47 of file SpinningCube.h.
|
staticprivate |
the vertex normals for the generic cube with pivot in (0,0,0) and edge length 2
Definition at line 46 of file SpinningCube.h.
|
staticprivate |
the vertex positions for a generic cube with pivot in (0,0,0) and edge length 2
Definition at line 45 of file SpinningCube.h.