Changing rendering states

Rendering states can be animated, too. A number of effects can be generated by altering the properties of one or more rendering attributes, including fade-in and fade-out, density and variation of the atmosphere, fog, changing the direction of light beams, and so on. We can easily implement a state animation in the update callback. We may either retrieve the attribute object from the arguments of the overridden method, or just manage the object as a member variable of the user-defined callback. Remember to make use of smart pointers, to ensure that the member attribute won't be automatically destroyed if it is no longer referenced.

The ease motion classes can be used to improve the animation quality. We must allocate an ...

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.