# Is it possible that vtk implements pagelod, similar to osg

**URL:** https://discourse.vtk.org/t/is-it-possible-that-vtk-implements-pagelod-similar-to-osg/10664
**Category:** Support
**Created:** [February 13, 2023, 3:32am UTC](https://discourse.vtk.org/t/is-it-possible-that-vtk-implements-pagelod-similar-to-osg/10664 "2023-02-13T03:32:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kingui1106](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kingui1106/32/3780_2.png) [@kingui1106](https://discourse.vtk.org/u/kingui1106)
#### Post date: [February 13, 2023, 3:32am UTC](https://discourse.vtk.org/t/is-it-possible-that-vtk-implements-pagelod-similar-to-osg/10664/1 "2023-02-13T03:32:37Z")

</div>

[osg pagelod example](https://github.com/openscenegraph/OpenSceneGraph/blob/master/examples/osgpagedlod/osgpagedlod.cpp)  
[PagedLOD - FlightGear wiki](https://wiki.flightgear.org/PagedLOD)

---

<div class="post-metadata">

### Author: ![kingui1106](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kingui1106/32/3780_2.png) [@kingui1106](https://discourse.vtk.org/u/kingui1106)
#### Post date: [February 13, 2023, 3:38am UTC](https://discourse.vtk.org/t/is-it-possible-that-vtk-implements-pagelod-similar-to-osg/10664/2 "2023-02-13T03:38:17Z")

</div>

Here is a simple example of creating a osg::PagedLOD node with two children nodes, one is a local geometry and the other is an external model file.  
This code creates a PagedLOD node that displays a box when the eye point is within 1000 units from the node, and displays a cow model when the eye point is beyond 1000 units from the node. The cow model is loaded from the file “cow. osg” in the current directory.

```auto
// create a PagedLOD node
osg::ref_ptr<osg::PagedLOD> plod = new osg::PagedLOD();
plod->setName("plod for example");

// set the range mode to distance from eye point
plod->setRangeMode(osg::LOD::DISTANCE_FROM_EYE_POINT);

// create a local geometry as the first child node
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),10.0f)));
plod->addChild(geode.get());

// set the range of the first child node to [0, 1000]
plod->setRange(0, 0.0f, 1000.0f);

// set the file name of the second child node to "cow.osg"
plod->setFileName(1, "cow.osg");

// set the range of the second child node to [1000, FLT_MAX]
plod->setRange(1, 1000.0f, FLT_MAX);

// set the database path to the current directory
plod->setDatabasePath("./");

```

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [February 14, 2023, 10:26pm UTC](https://discourse.vtk.org/t/is-it-possible-that-vtk-implements-pagelod-similar-to-osg/10664/3 "2023-02-14T22:26:36Z")

</div>

Hello,

So, what are you getting?

regards,

Paulo
