O'Reilly logo

Mastering openFrameworks: Creative Coding Demystified by Denis Perevalov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required