osg-users,您好!
does something wrong in the following code?
void setToBoundingBox(const BoundingBox& bb)
{
_planeList.clear();
_planeList.push_back(Plane(1.0,0.0,0.0,-bb.xMin())); // left plane.
_planeList.push_back(Plane(-1.0,0.0,0.0,bb.xMax())); // right plane.
_planeList.push_back(Plane(0.0,1.0,0.0,-bb.yMin())); // bottom
plane.
_planeList.push_back(Plane(0.0,-1.0,0.0,bb.yMax())); // top plane.
_planeList.push_back(Plane(0.0,0.0,-1.0,bb.zMin())); // near plane
_planeList.push_back(Plane(0.0,0.0,1.0,bb.zMax())); // far plane
setupMask();
}
when I want to create a boundingbox with the two point V_min(20,20,20),
V_max(100,100,100) correctly, I must use like that
osg::Polytope pt;
pt.setToBoundingBox(osg::BoundingBox(20,20,100,100,100,-20));
May be the code shuoud change to:
void setToBoundingBox(const BoundingBox& bb)
{
_planeList.clear();
_planeList.push_back(Plane(1.0,0.0,0.0,-bb.xMin())); // left plane.
_planeList.push_back(Plane(-1.0,0.0,0.0,bb.xMax())); // right plane.
_planeList.push_back(Plane(0.0,1.0,0.0,-bb.yMin())); // bottom
plane.
_planeList.push_back(Plane(0.0,-1.0,0.0,bb.yMax())); // top plane.
_planeList.push_back(Plane(0.0,0.0,1.0,-bb.zMin())); // near plane
_planeList.push_back(Plane(0.0,0.0,-1.0,bb.zMax())); // far plane
setupMask();
}
ps: this bug is pointed by array(who translated the
OpenSceneGraph_Quick_Start_Guide to Chinese).
致
礼!
祝清鲁
[EMAIL PROTECTED]
2007-12-02
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org