[osg-users] replace tile with my own Node in VPB generated QuadTree

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Sat Dec 3 17:15:18 PST 2016

Thanks Sebastion, Robert,

I did indeed dump the part of the scene into osgt and here is the hierarchy
(GeometryTechnique used):
PagedLOD->Group->TerrainTile (4x these)->MatrixTransform->Geode

After some experiments I am successful now in injecting my own node (simply
replaced the Geode with my own Geometry). I am after replacing the
TerrainTile with Group or MatrixTransform. Havn't looked into TerrainTile
but probably this contains some transformation (which one, the local to
ECEF??) since simply replacing it by Group is not working

Also, In my replacement of the original VPB Geode, I am using Geometry
where I am generating normals with osgUtil::SmoothingVisitor, and these are
wrong in the final output as well. Any clue?

Thanks a bunch for so far


On Sat, Dec 3, 2016 at 5:04 PM, Sebastian Messerschmidt <
sebastian.messerschmidt at gmx.de> wrote:

> Hi Nick,
> Hi Robert, Community,
> I am hacking the VPB process again :-).
> The story is this: I transform tiles back from ECEF to local, do something
> with the Geometry and I want to replace the tile with my own Node. Spent
> already hours reading and trying to understand the SceneGraph with all this
> transforms, and I am failing.
> Any words of how these tiles in the QuadTree are represented? I mean the
> tree and the transforms, I know the facts that they are coming from
> TerrainTiles with proper Locators, but after when the GeometryTechnique is
> applied.
> I worked it out some years ago, where I needed to capture the
> transformations for a query-representation. Basically you will have a
> height field-layer inside the terrain-tile, which describes itself via a
> Locator and the height-values in a normalized coordinate frame. IIRC the
> complete ECEF-Transform is captured inside the locator. It simply assumes
> the height-field as being centered around the geographic position when
> creating the world-geometry.
> Some snippet to retrieve the world-coordinates of the terrain-tile's
> center:
> <code>
>         osgTerrain::TerrainTile& terrain_tile = dynamic_cast<osgTerrain::
> TerrainTile&>(node);
>         osgTerrain::HeightFieldLayer* hf_layer= dynamic_cast<osgTerrain::
> HeightFieldLayer*>(terrain_tile.getElevationLayer());
>         osgTerrain::Locator* locator = terrain_tile.getLocator();
>         osg::EllipsoidModel* es = locator->getEllipsoidModel();
>         //compute center transform
>         osg::Vec3d center_model;
>         tile ->convertLocalToModel(osg::Vec3d(0.5,0.5,0.0), center_model);
> </code>
> I'm not quite sure which coordinate frame is used in the quadtree itself,
> but it should be easy enough to put some subgraph to an osgt to inspect.
> Cheers
> Sebastian
> Thanks so much for any word on this. It is the last bump in my current dev
> Cheers,
> Nick
> --
> trajce nikolov nick
> _______________________________________________
> osg-users mailing listosg-users at lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161204/b405ea1f/attachment-0002.htm>

More information about the osg-users mailing list