-
Book Overview & Buying
-
Table Of Contents
OpenSceneGraph 3.0: Beginner's Guide
This is the last example in our OSG beginners' book, in which we would like to show how OSG handles massive data (often massive terrain data) with the quad-tree structure and paged nodes (osg::PagedLOD). We are going to construct a terrain model with fake elevation data, and use a recursion to build all child cells of a complete quad-tree. These cells are saved into separate files and managed by the osgDB::DatabasePager, which is introduced in brief in Chapter 5,
Managing Scene Graph
Include the necessary headers:
#include <osg/ShapeDrawable> #include <osg/PagedLOD> #include <osgDB/WriteFile> #include <sstream>
Define some global variables. These will define the dimensions of a regularly-spaced grid of elevation points, including the data pointer (g_data), intervals of X and Y directions (g_dx and g_dy), rows and columns of the leaf cell in the quad-tree (g_minCols and g_minRows), and rows and columns of the...
Change the font size
Change margin width
Change background colour