-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
OpenSceneGraph 3.0: Beginner's Guide
It is common practice to modify geometries' vertices and primitive attributes dynamically. We can change the position, normal, color, and texture coordinate of each vertex, as well as related primitives per frame, in order to implement kinds of morph animations. During the modifications, it is important to keep an eye on the data variance, because the draw traversal might be running while updating vertices and primitives, which might cause conflicts and even crashes.
In this example, we will make use of the quad geometry that was created in Chapter 4, Building Geometry Models. We will simply alter its last vertex and make it rotate around the X axis, which results in a simple animation effect.
Include the necessary headers:
#include <osg/Geometry> #include <osg/Geode> #include <osgViewer/Viewer>
The creation of a quad is familiar to us. Specify the vertex, normal, and color array, and add a primitive set to indicate that all vertices...
Change the font size
Change margin width
Change background colour