Drawing line segments and points
Instead of mesh.draw()
, you can use the following functions:
The
mesh.drawWireframe()
function draws only surface edges without the interiors of the triangles. Such a mode of drawing is called wireframe drawing; it is very useful for debugging, and of course, can be used as an effect.The
mesh.drawVertices()
function draws only vertices of the mesh. It is useful for debugging and also as an effect.
Also, to represent not only triangular surfaces but also objects consisting of line segments or points, use the mesh.setMode( mode )
function, where mode
has type ofPrimitiveMode
enumeration. To see all the possible values for mode
, check its definition. We will mention only three values:
OF_PRIMITIVE_TRIANGLES
is a default value, which draws a mesh as triangles. We had considered how to use thismode
in the pyramid examples mentioned earlier.OF_PRIMITIVE_LINES
draws a mesh as a number of line segments.OF_PRIMITIVE_POINTS
draws a mesh as a number of points.
Let...