Hi all,
the current implementation (svn trunk) of
'IntersectionVisitor::apply(Billboard&)'
is erroneous, because it ignores the transformation of the billboard.
So I tried to correct it by looking at 'IntersectionVisitor::apply(Transform&)'
and
'CullVisitor::apply(Billboard&)':
void IntersectionVisitor::apply(osg::Billboard& billboard)
{
if (!enter(billboard)) return;
osg::Vec3d eye_local = (! _modelStack.empty()
?
osg::Matrix::inverse(*_modelStack.back()).getTrans()
: osg::Vec3d(0.0f, 0.0f, 0.0f));
for(unsigned int i=0; i<billboard.getNumDrawables(); ++i)
{
const osg::Vec3& pos = billboard.getPosition(i);
osg::ref_ptr<osg::RefMatrix> matrix = _modelStack.empty() ? new
osg::RefMatrix() : new osg::RefMatrix(*_modelStack.back());
billboard.computeMatrix(*matrix, eye_local, pos);
pushModelMatrix(matrix.get());
push_clone();
intersect(billboard.getDrawable(i));
pop_clone();
popModelMatrix();
}
leave();
}
Unfortunately this version doesn't work. Any ideas?
Regards,
Daniel
--
Daniel Trstenjak Tel. +49 (0)7071-9457-264
science + computing ag FAX +49 (0)7071-9457-511
Hagellocher Weg 73 mailto: [EMAIL PROTECTED]
D-72070 Tübingen WWW : http://www.science-computing.de/
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/