|
楼主 |
发表于 2014-8-10 14:38:00
|
显示全部楼层
我是在事件响应中使用求交,Drag的时候会求交,返回的是该点当时的Z坐标,怎么把前面的Z坐标释放呢?
case osgGA::GUIEventAdapter:RAG:
{
osgUtil:ineSegmentIntersector::Intersections inters;
if(viewer->computeIntersections(ea.getX(),ea.getY(),inters))
{
osgUtil::LineSegmentIntersector::Intersections::iterator iter=inters.begin();
osg::Vec3d pos = iter->getWorldIntersectPoint()
pos.z() += 0.1;
viewer->getSceneData()->asGroup()->addChild(createCube(osg::Vec3(0.0,0.0,1.0),pos.z()));
} |
|