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, 祝清鲁 <[EMAIL PROTECTED]> 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).
>
> 致
> 礼!
>
>
> 祝清鲁
> [EMAIL PROTECTED]
> 2007-12-02
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to