The Image class

In the last chapter, we have already learnt how to create a quad and fill it with color. However, another idea is to apply it with a texture map (often a bitmap or raster image). This does not affect the vertices of a surface, but only changes final pixel data, which is more efficient and suitable for representing object details in most cases.

OSG provides several texture attributes and modes for texture mapping operations, which will be introduced in the next section. Before that, we will have to discuss the osg::Image class, which stores image data for OpenGL texture objects to upload and use.

The best way to load an image from a disk file is to use the osgDB::readImageFile() function. This is very similar to the osgDB::readNodeFile() ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.