O'Reilly logo

openFrameworks Essentials by Denis Perevalov, Igor Tatarnikov

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 a wireframe sphere

Let's start working with 3D by creating a sphere surface and drawing it as a wireframe model.

Tip

A wireframe model is a type of graphical representation of a 3D object on the screen where only its edges are drawn. It appeared in the early era of 3D graphics as a simple way to draw objects in 3D. Now, it is used in 3D modeling software to control the structure of the created objects and as a special effect in films, games, and experimental graphics.

We will achieve this using the ofSpherePrimitive class in the following way:

  1. Add the sphere object definition to the ofApp class, as follows:
    ofSpherePrimitive sphere;
  2. Initialize the sphere in setup():
    sphere.set(250, 20);

    Here, the first argument, 250, is the radius of the sphere. ...

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