Clamping models to an osgTerrain

44 views
Skip to first unread message

Brad Colbert

unread,
Dec 20, 2019, 6:53:08 PM12/20/19
to OpenSceneGraph Users
Hi folks,

I googled but not found an answer that goes into this.  

I have what can be considered a town and want to clamp the buildings to the terrain (obviously).

What I would prefer is to have some pre-process that runs intersectors on the terrain, pushing up (or down) through the PagedLODs, placing the model at the appropriate height, and then saving that tile back out.  This way the models just get loaded in with the PagedLOD and are already at the right height as the terrain height pops up and down based on the LOD.

Is this even possible with 3.6?  If so, any ideas, thoughts, pointers?

Best,
Brad

Robert Osfield

unread,
Jan 9, 2020, 4:41:25 AM1/9/20
to OpenSceneGraph Users
I don't know of any off the open sourced tools that do this for you.  It was always something I had on my wish list for VirtualPlanetBuilder but never had the time/funding to tackle it.

The post processing of paged database is something that has been done over the years for various purposes. 

Combing the TerrainTile height fields with cultral data - trees, roads, houses would require one to positioning of the cultral data to the appropriate height, then meshing the tile's height field taking into account the outlines/points of the cultural data being added if you want an exact match.  The remeshing will be the hardest part of this work, so I'd suggest tackling the positioning first then add the meshing later.

Brad Colbert

unread,
Jan 9, 2020, 2:24:51 PM1/9/20
to OpenSceneGraph Users
Robert, thank you for the reply.  The community-crickets were a little disconcerting.

I don't think it has to be as complicated as you described.  Simply finding the height at the location of the object, placing it there, and placing a file reference within that tile's hierarchy so that the model file is paged in (or not if it's already in the cache).  Do this for every tile in the hierarchy and you are done.  That would be a major jump in capability, at this point.

Either way, I'm simply looking to do the above and wondering if it appears feasible with current capabilities.

Best,
Brad

Robert Osfield

unread,
Jan 11, 2020, 5:36:10 AM1/11/20
to OpenSceneGraph Users
Doing what you describe is possible with existing functionality, it just isn't implemented for you.  The complicated part in this type of work is the meshing of the terrain to the cultural data, if you don't need this level of fidelity then just putting a transform above a model and inserting this into tile on disk would work well.
Reply all
Reply to author
Forward
0 new messages