|
大家好,我现在碰到这样一个问题,用鼠标选择场景中的模型:在非立体的情况下,可以很好的选择模型,现在在被动立体(垂直分割)时,选择模型(如附件图),只能在上下两副图之间选择模型,不知道怎么在选择上面一幅图或下面一幅图就可以选中模型
osgUtil:ineSegmentIntersector::Intersections intersections;
float xpos=ea.getX();
float ypos=ea.getY();
osg:isplaySettings* pDispSettings = osg::DisplaySettings::instance();
if(pDispSettings->getStereo()==true)
{
if(pDispSettings->getStereoMode()==osg::DisplaySettings::HORIZONTAL_SPLIT)
{
xpos+=0.25f*ea.getWindowWidth();
}
else if(pDispSettings->getStereoMode()==osg::DisplaySettings::VERTICAL_SPLIT)
{
ypos+=0.25f*ea.getWindowHeight();
}
}
bool foundIntersection;
foundIntersection = view->computeIntersections(xpos,ypos,intersections); |
|