Hi John, VPB builds purely static databases that are stored on disk to be later loaded by the runtime that visualizes it. Since you want to vary the vertical exaggeration at runtime then the solution will have to be entirely on the OSG side, VPB actually has little to do with the actual implementation.
In terms of implementation the route to take is write a Registry::ReadFileCallback that is called on the load of each new subgraph, see include/osgDB/Registry. Your callback will need to runs a custom NodeVisitor that modifies the underlying geometries height. Things that will complicate things are that the osg::Geometry leaves will be local coordinate frame undernearth an osg::MatrixTransform that places them in their final geocentric position, so you'll need to transform the local vertices into world coords, then compute the height about the ellipsoid, then compute the new position at the same lat/long but at the new height, then finally transform the point back into local coords. If you are building with the VPB --terrain option rather than the default then you get osgTerrain based tiles, then you'll probably want a feature that hasn't been written yet... Robert. On Mon, May 19, 2008 at 2:14 PM, John Vidar Larring <[EMAIL PROTECTED]> wrote: > Hi, > > When creating globes with VPB one can use the option -v (vertical > multiplier) to set permanent vertical exaggeration for the generated model. > However, in our software solution the user must be able to set vertical > exaggeration from the GUI (i.e. dynamically alter vertical exaggeration). > > What I'd like to know is: What would be a good strategy for implementing > dynamic vertical exaggeration of VPB models? > > I am pretty new to OSG, so I would greatly appreciate any suggestions that > could help to start me of in the right direction. > > My preliminary gut feeling is that the following strategy could possibly > work: > > - Implement a node visitor to find all geode's in model. > - For each geode, traverse each child drawable with an ArrayVisitor. > - In the ArrayVisitor recalculate each vertex based on earth radius from > CoordinateSystemNode/EllipsoidModel, distance from vertex to earth center, > and vertical multiplier. > > Is this feasible? Are there any better strategies to follow? Performance > issues/considerations when operation on ~50GB PagedLOD databases. > > Any hint and suggestions are very much appreciated. If anyone has example > code that solves similar problems, I would kiss his/her feet in gratitude:) > (not literally though;) > > Best regards, > John > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org