Hi Robert,
I only load the OSGTerrain with the osgDB::readNodeFile() and add it to a
osg::CoordinateSystemNode() and add the osg::CoordinateSystemNode() to the
scene graph with a osg::PositionAttitudeTransform. Not that update callback of
the osg::PositionAttitudeTransform is correctly called.
The code look like this:
osg::ref_ptr<osg::Node> lMap = osgDB::readNodeFile("filename.ive");
osg::ref_ptr<osg::Group>lCSN = new
osg::CoordinateSystemNode(*static_cast<osg::CoordinateSystemNode*>(lMap.get()));
and add lCSN to the sceen graph.
The .osg version of the file look like this:
-------------------------------------------
CoordinateSystemNode {
nodeMask 0xffffffff
cullingActive TRUE
Format "WKT"
CoordinateSystem "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS
84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]"
num_children 1
osgTerrain::TerrainTile {
UniqueID TerrainTile_0
nodeMask 0xffffffff
cullingActive TRUE
osgTerrain::Locator {
UniqueID Locator_1
Format "WKT"
CoordinateSystem "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS
84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]"
CoordinateSystemType PROJECTED
TransformScaledByResolution FALSE
Transform {
1 0 0 0
0 1 0 0
0 0 1 0
66 32 0 1
}
}
ElevationLayer {
osgTerrain::HeightFieldLayer {
Use Locator_1
MinFilter LINEAR_MIPMAP_LINEAR
MagFilter LINEAR
HeightField {
UniqueID HeightField_2
Origin 66 32 0
XInterval 0.0158730167895556
YInterval 0.0158730167895556
SkirtHeight 0.0141421351581812
BorderWidth 0
Rotation 0 0 0 1
NumColumnsAndRows 64 64
Heights
{
.............................Array of numbers
}
}
}
}
ColorLayer {
osgTerrain::ImageLayer {
Use Locator_1
MinFilter LINEAR_MIPMAP_LINEAR
MagFilter LINEAR
file terrain_66_32_L0_X0_Y0.dds
}
}
}
}
--------------------------------------
Thank you!
Cheers,
Sylvain
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59463#59463
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org