<div>        win10&osg3.6.4</div><div>        // </div><div>        osg::Matrixd proj  = osg::Matrixd::identity();</div><div><span style="white-space:pre"> </span>proj.makePerspective(60, frustumAspectWidth/frustumAspectHeight, frustumNear, frustumFar);</div><div><span style="white-space:pre">    </span>//</div><div><span style="white-space:pre">    </span>const double mynear = proj(3, 2) / (proj(2, 2) - 1.0);</div><div><span style="white-space:pre">        </span>const double myfar = proj(3, 2) / (1.0 + proj(2, 2));</div><div><span style="white-space:pre"> </span>//</div><div><span style="white-space:pre">    </span>const double nLeft = mynear * (proj(2, 0) - 1.0) / proj(0, 0);</div><div><span style="white-space:pre">        </span>const double nRight = mynear * (1.0 + proj(2, 0)) / proj(0, 0);</div><div><span style="white-space:pre">       </span>const double nTop = mynear * (1.0 + proj(2, 1)) / proj(1, 1);</div><div><span style="white-space:pre"> </span>const double nBottom = mynear * (proj(2, 1) - 1.0) / proj(1, 1);</div><div><span style="white-space:pre">      </span>const double fLeft = myfar * (proj(2, 0) - 1.0) / proj(0, 0);</div><div><span style="white-space:pre"> </span>const double fRight = myfar * (1.0 + proj(2, 0)) / proj(0, 0);</div><div><span style="white-space:pre">        </span>const double fTop = myfar * (1.0 + proj(2, 1)) / proj(1, 1);</div><div><span style="white-space:pre">  </span>const double fBottom = myfar * (proj(2, 1) - 1.0) / proj(1, 1);</div><div><span style="white-space:pre">       </span>//</div><div><span style="white-space:pre">    </span>_projectPt[0] = osg::Vec3d(0.0, 0.0, 0.0);</div><div><span style="white-space:pre">    </span>_projectPt[1] = osg::Vec3d(nLeft, nBottom,  -mynear);</div><div><span style="white-space:pre">    </span>_projectPt[2] = osg::Vec3d(nRight, nBottom, -mynear);</div><div><span style="white-space:pre"> </span>_projectPt[3] = osg::Vec3d(nRight, nTop, -mynear);</div><div><span style="white-space:pre">    </span>_projectPt[4] = osg::Vec3d(nLeft, nTop,  -mynear);</div><div><span style="white-space:pre">       </span>_projectPt[5] = osg::Vec3d(fLeft, fBottom,  - myfar);</div><div><span style="white-space:pre">    </span>_projectPt[6] = osg::Vec3d(fRight, fBottom, - myfar);</div><div><span style="white-space:pre"> </span>_projectPt[7] = osg::Vec3d(fRight, fTop,  -myfar);</div><div><span style="white-space:pre">       </span>_projectPt[8] = osg::Vec3d(fLeft, fTop,  - myfar);</div><div><span style="white-space:pre">       </span></div><div><span style="white-space:pre">      </span>osg::Polytope viewFrstumPoly;</div><div><span style="white-space:pre"> </span>//</div><div><span style="white-space:pre">    </span>osg::Matrixd ViewM = _view->getCamera()->getInverseViewMatrix();</div><div><span style="white-space:pre">        </span>//</div><div><span style="white-space:pre">    </span>osg::Vec3d tempProjectPt[9];</div><div><span style="white-space:pre">  </span>//tempProjectPt[0] = _projectPt[0] * ViewM;</div><div><span style="white-space:pre">   </span>tempProjectPt[1] = _projectPt[1] * ViewM;</div><div><span style="white-space:pre">     </span>tempProjectPt[2] = _projectPt[2] * ViewM;</div><div><span style="white-space:pre">     </span>tempProjectPt[3] = _projectPt[3] * ViewM;</div><div><span style="white-space:pre">     </span>tempProjectPt[4] = _projectPt[4] * ViewM;</div><div><span style="white-space:pre">     </span>tempProjectPt[5] = _projectPt[5] * ViewM;</div><div><span style="white-space:pre">     </span>tempProjectPt[6] = _projectPt[6] * ViewM;</div><div><span style="white-space:pre">     </span>tempProjectPt[7] = _projectPt[7] * ViewM;</div><div><span style="white-space:pre">     </span>tempProjectPt[8] = _projectPt[8] * ViewM;</div><div><span style="white-space:pre">     </span></div><div><span style="white-space:pre">      </span>{</div><div><span style="white-space:pre">             </span>viewFrstumPoly.add(osg::Plane(tempProjectPt[1],tempProjectPt[5],tempProjectPt[8]));</div><div><span style="white-space:pre">   </span>}</div><div><span style="white-space:pre">     </span></div><div><span style="white-space:pre">      </span>{</div><div><span style="white-space:pre">             </span>viewFrstumPoly.add(osg::Plane(tempProjectPt[2],tempProjectPt[7],tempProjectPt[6]));</div><div><span style="white-space:pre">   </span>}</div><div><br></div><div><span style="white-space:pre">    </span>{</div><div><span style="white-space:pre">             </span>viewFrstumPoly.add(osg::Plane(tempProjectPt[3], tempProjectPt[4],tempProjectPt[8]));</div><div><span style="white-space:pre">  </span>}</div><div><br></div><div><span style="white-space:pre">    </span>{</div><div><span style="white-space:pre">             </span>viewFrstumPoly.add(osg::Plane(tempProjectPt[1],tempProjectPt[2],tempProjectPt[6]));</div><div><span style="white-space:pre">   </span>}</div><div><span style="white-space:pre">     </span></div><div><span style="white-space:pre">      </span>{</div><div><span style="white-space:pre">             </span>viewFrstumPoly.add(osg::Plane(tempProjectPt[5],tempProjectPt[6],tempProjectPt[7]));</div><div><span style="white-space:pre">   </span>}</div><div><span style="white-space:pre">     </span></div><div><span style="white-space:pre">      </span>{</div><div><span style="white-space:pre">             </span>viewFrstumPoly.add(osg::Plane(tempProjectPt[3],tempProjectPt[4],tempProjectPt[1]));</div><div><span style="white-space:pre">   </span>}</div><div><span style="white-space:pre">     </span>osg::ref_ptr<osgUtil::PolytopeIntersector> picker = new osgUtil::PolytopeIntersector(osgUtil::Intersector::MODEL, poly);</div><div><span style="white-space:pre">        </span>picker->setPrecisionHint(osgUtil::Intersector::USE_DOUBLE_CALCULATIONS);</div><div><span style="white-space:pre">   </span>picker->setPrimitiveMask(osgUtil::PolytopeIntersector::POINT_PRIMITIVES);</div><div><span style="white-space:pre">  </span>picker->setIntersectionLimit(osgUtil::Intersector::NO_LIMIT);</div><div><span style="white-space:pre">      </span>//</div><div><span style="white-space:pre">    </span>osgUtil::IntersectionVisitor iv(picker);</div><div><span style="white-space:pre">      </span>_videoFusionNode->accept(iv);//group of scene </div><div><span style="white-space:pre">        </span>if (picker->containsIntersections())</div><div><span style="white-space:pre">       </span>{</div><div><span style="white-space:pre">             </span>//</div><div><span style="white-space:pre">    </span>}</div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/32729314-2d08-46c7-973c-812c6d8a2bb0n%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/32729314-2d08-46c7-973c-812c6d8a2bb0n%40googlegroups.com</a>.<br />