Hi,
I have a problem with my billboards and their boundingbox.
I create a vector of osg::billboard (vector_cibles) which contains a cylinder
drawable and its position (position in a cibles array)
Code:
std::vector<osg::Vec3f>::iterator it=tableau_cibles.begin();
for (it;it!=tableau_cibles.end();it++)
{
Billboards = new osg::Billboard();
Billboards->addDrawable(new osg::ShapeDrawable(new
osg::Cylinder(osg::Vec3d(0.0, 0.0, 0.0), 2,0.2)),(*it));
Billboards->setMode(osg::Billboard::AXIAL_ROT);
Billboards->setAxis(osg::Vec3d(0.0, 1.0, 0.0));
Billboards->setNormal(osg::Vec3d(0.0, 0.0, 1.0));
Billboards->setStateSet(state);
vector_cibles.push_back(Billboards.get());
}
And when i want get back the bounding box of my drawable's billboard like that
:
Code:
std::vector< osg::ref_ptr<osg::Billboard> >::iterator it_vector_cibles
= vector_cibles.begin();
for
(it_vector_cibles;it_vector_cibles!=vector_cibles.end();it_vector_cibles++)
{
const osg::BoundingBox& BoundingBoxs =
(*it_vector_cibles)->getDrawable(0)->getBound();
bs1 =
osg::Vec3f(BoundingBoxs.xMin(),BoundingBoxs.yMin(),BoundingBoxs.zMin());
bs2 =
osg::Vec3f(BoundingBoxs.xMax(),BoundingBoxs.yMax(),BoundingBoxs.zMax());
std::cout << bs1[0] << ' ' << bs1[1] <<' '<< bs1[2]
<<std::endl;
std::cout << bs2[0] << ' ' << bs2[1] <<' '<< bs2[2]
<<std::endl;
}
i have ALWAYS:
bs1 = (-2, -2 , -0.1)
bs2 = (2, 2 ,0.1)
My problem is : i can't get back (xMax,xMin,yMax,...) of each drawable's
billboard. Each drawable has a different position.
...
Thank you!
Cheers,
Romain
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=20987#20987
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org