7 pointerfieldtypes=
"none"
10 parentsystemcomponent=
"true"
12 docGroupBase=
"GrpGroupMisc"
14 This Node manages the different levels of detail available for a Geometry
15 and decides which one should be rendered, according to the distance from the
16 current camera. The details of the selection process are taken from VRML97
19 The node chooses which child to render based on the range values in the Range
20 multi-field and the current distance of the camera from the object.
21 The children should be ordered from the highest level of detail to the
22 lowest level of detail. The range values specify the distances at which to
23 switch between the different children.
25 The center field is a translation offset in the local coordinate system that
26 specifies the center of the object for distance calculations. In order to
27 calculate which level to display, first the distance from the
28 viewpoint to the center point of the LOD node (with corresponding
29 transformations) is computed. If the distance is less than the first range
30 value, then the first LOD is drawn. If it is between the first and the second
31 values, then the second LOD is drawn, and so on.
33 \example Setting up a OSG::DistanceLOD
35 Here is an example of setting up an lod core with a center and a range.
36 You would also need to add children for the
4 LODs.
39 DistanceLOD lod = DistanceLOD::create();
41 // this is supposed to be the center of the LOD model,
42 // that is, this is the point the distance is measured from
43 lod-
>setCenter(
12,
1,
5);
44 // now we add the distances when models will change
45 lod-
>editMFRange()-
>push_back(
6.0);
46 lod-
>editMFRange()-
>push_back(
12.0);
47 lod-
>editMFRange()-
>push_back(
24.0);
57 The center for distance calculation.