Manage terrain detail for intersection calculation via osgSim::LineOfSight

classic Classic list List threaded Threaded
1 message Options
ertanataman ertanataman
Reply | Threaded
Open this post in threaded view
|

Manage terrain detail for intersection calculation via osgSim::LineOfSight

During LineOfSight calculation if related area is zoomed in at least once the calculation returns sensitive results but if not zoomed it is not sensitive.
Here is my code:

const LineOfSight::Intersections& getIntersections( double latStart, double lonStart, double altStart,`
        double latEnd, double lonEnd, double altEnd )
{
        static LineOfSight los;
        los.clear();
        const Vec3 startPos = geodetic2Ned( latStart, lonStart, altStart );
        const Vec3 endPos = geodetic2Ned( latEnd, lonEnd, altEnd );

        int losId = los.addLOS( startPos, endPos );
        los.computeIntersections(terrainNode );

        return los.getIntersections( losId );
}

terrainNode is MapNode that is loaded from earth file that includes
I think what I need is prepare enough detail for terrainNode around the line segment. How can I achieve this?

Also encountered this and trying to apply my situation but could not do much yet
http://forum.osgearth.org/How-to-get-accurate-elevation-information-td7592381.html#a7592382