[osg-users] osgTerrain::TerrainTile not in parental list (??)

Robert Osfield robert.osfield at gmail.com
Tue Dec 6 01:17:31 PST 2016

Hi Nick,

On 6 December 2016 at 05:38, Trajce Nikolov NICK
<trajce.nikolov.nick at gmail.com> wrote:
> Hi Robert, Community,
> This might sounds stupid so I am apologize upfront. I spent some time
> reading the code of TerrainTile and I am seeing it as a Group (right?). When
> using NodeVisitors I am seeing the TerrainTiles as part of the scene. When I
> want to use it as ordinary Group it is not.
> For example, I have this scene:
> PagedLOD->Group->TerrainTile->MatrixTransform->Geode
> MatrixTransform is reporting 0 numParents and Geode->getParentalNodePaths is
> up to the MatrixTransform
> I am confused. I am after replacing the TerrainTile with my own Group/Node

The TerrainTile "has a" TerrainTechnique, and it's the concrete
TerrainTechnique (such as GeometryTechnique) to take the elevant and
image layers assigned to the TerrailTile and create a local subgraph
capable of rendering that data.

It's entirely up to the TerrainTechnique how it creates and manages
it's own local subgraph graph, and typically won't directly assign it
to the main scene graph, rather it it's self contained within the
TerrainTechnique, this means the parent can be null for the topmost
node in the local subgraph.  This subgraph is still traversed because
TerrainTile calls TerrainTechnique on each traversal, and the
TerrainTechnique implementation can decide how best to do the
traversal of it's local subgraph.

The fact that the local subraphs are traversed means that the
NodeVisitor's that are doing the traversal will collect the full
NodePath from the root of the scene graph down through the TerrainTile
to the local subgraph, so if you want  the parental chain then a
visitor will provide this for you.


More information about the osg-users mailing list