Hi All,
I want to find a point on the terrain(.osga) so that i can place my
model at that point.
This is what i am doing
osg::Node* terrainNode = osgDB::readNodeFile("terrain.osga")
osg::BoundingSphere bS = terrainNode->getInitialBound();
osg::Vec3 centre = bS.center();
float radius = bS.radius();
osg::Vec3 v0(centre.x(),centre.y(),centre.z()+999.0);
osg::Vec3 v1(centre.x(),centre.y(),centre.z()-999.0);
//get intersecton function returns the intersection point :the function
//is written using osgUtil::IntersectionVisitor
osg::Vec3 initialTankPos = getIntersectionPoint(v0,v1,terrainNode);
The problem is i am not able to find intersection point. When i uses
JoeDirt.flt terrain i am able to find intersection point which means
that the function "getIntersectionPoint"is working fine. But when i use
"terrain.osga" which i have created using osgdem i am not able to find
any intersection point.
can somebody tell me what is going wrong?
best regards
Rahul Jain
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/