20/21

10. Drawing shapes

The following code proposes a set up allowing to easily draw shapes.

  • The code contains an additional helper file shape (cpp, hpp) able to generate meshes from basic parametric primitives (plane, sphere, cylinder).

  • Each set of identifiant used to draw a shape are stored in the struct shape_gpu. Several shapes can be stored in a std::map and acccessed under a user defined name.

  • Model transformation are also send to vertex shader in order to set position and orientation. Note that before each drawing, the uniform parameters are setup.


[ source ]

scene

  • Compile and execute the code, make sure you understand the new big steps and functions of this code.