[osg-users] a bug in "void osg::Polytope::setToBoundingBox ( const BoundingBox & bb ) [inline] "
Robert Osfield
robert.osfield at gmail.com
Sun Dec 2 07:28:19 PST 2007
Hi,
Yesterday another engineer reported this issue, a fix was posted by
myself and also checked into OSG subversion repository. FYI, the
setFrustum method was also buggy in the same way.
Robert.
On Dec 2, 2007 1:28 AM, 祝清鲁 <zhuqinglu316 at 163.com> wrote:
> 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).
>
> 致
> 礼!
>
>
> 祝清鲁
> zhuqinglu316 at 163.com
> 2007-12-02
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
More information about the osg-users
mailing list