Terrain and Lines

classic Classic list List threaded Threaded
4 messages Options
Reuben Reuben
Reply | Threaded
Open this post in threaded view
|

Terrain and Lines

Hello,

Is it possible to draw colored lines along the edges of loaded terrain?  Also would this cause the CPU to be overworked?

Reuben
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Terrain and Lines

Can you elaborate on what you're looking to do?

Glenn
Glenn Waldron / Pelican Mapping
Reuben Reuben
Reply | Threaded
Open this post in threaded view
|

Re: Terrain and Lines

I want to be able to specify two points and draw a line.  If there is terrain loaded between these two points, I want to detect the terrain attributes and draw the line along the edges of the terrain.  For example, if I cannot detect the terrain, the line I am drawing might sit under a mountain.  Thanks.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Terrain and Lines

Sounds like you are talking about "draping" geometry over the terrain. In osgEarth, there are several "feature" drivers that take geometry (points, lines, polys) and render them as part of the map. One of these is probably the most appropriate:

agglite: rasterizes geometry to image tiles.
See the "feature_agglite.earth" sample, or
http://www.osgearth.org/wiki/TileSourcePluginAggLite

feature_stencil: uses a stencil buffering technique to render terrain-conforming vectors.
See the "feature_stencil_line_draping.earth" sample; or
http://www.osgearth.org/wiki/TileSourcePluginModelFeatureStencil

Hope this helps. Glenn
Glenn Waldron / Pelican Mapping