On 10/18/2010 7:05 AM, Robert Gosztyla wrote:
> Hi,
>> VPB isn't really intended for editing terrain, but it generates heightfields 
>> that can be dynamically altered at runtime just fine. You just have to be 
>> aware that there are multiple LODs of each terrain tile.
> Could you explain it with more detail? How i can alter heightfield in 
> runtime? You mean altering generated geometry or bitmap and then generated 
> geometry? Is this the way i could do some terrain editing feature?
> Now i'm trying to modify terrain geometry, but i still got the problem with 
> accessing data for it. I'm trying to use class derivied from NodeVisitor and 
> i call e.g. void CTerrainVisitor::apply( osg::Geode& geode ), where geode has 
> my terrain geometry. But what is the reference between terrain tile and given 
> geode object? Maybe there is some other, better method to use osgTerrain and 
> have possibility to edit it? Or osgTerrain is not best approach to have 
> editable terrain and i have to write my own wrapper for that?

  Well, deep down in every VPB-made osgTerrain database is a set of 
heightfields (arrays
of elevation values) and images. If you know what you're doing, you can examine 
and alter
these and force them to be updated by OSG (usually by marking the modified ones 
as dirty).

  I'm not clear on what exactly your questions were. You could use a 
NodeVisitor, but you
won't be messing with Geodes, you'll work with the heightfield and image 
objects and let
OSG rebuild the actually rendered geometry from those. You're not supposed to 
know or rely
on how OSG does that part because you shouldn't need to know if a Geode is 
involved or
some other terrain rendering technique.

> Cheers,
> Robert

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to