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

Texturing the sphere

Texturing is the technique to wrap a 2D image on a surface. In this case, the surface is called textured surface, and the image using for texturing is called texture.

Texturing involves the following three steps:

  1. The first step is preparing the texture image as an ofTexture object. We explored this class in the previous chapter. All the considered image and video classes—ofImage, ofVideoPlayer, ofVideoGrabber, and ofFbo—contain an ofTexture object instance that can be accessed by the getTextureReference() method. For example, video.getTextureReference() gets the ofTexture object for a current frame of video.
  2. Setting texture coordinates at each vertex of the surface is the second step. Texture coordinates at the given vertex ...

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