Re: [osg-users] ComputeBoundsVisitor does not consider Billboards

2017-10-20 Thread Guy Volckaert
If I have a chance, I'll try to look at it as well based on your suggestion 
solution. 

Cheers,
Guy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72217#72217





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ComputeBoundsVisitor does not consider Billboards

2017-10-20 Thread Robert Osfield
Hi Guy,

On 20 October 2017 at 15:34, Guy Volckaert 
wrote:

> My investigation led me to review osg::ComputeBoundsVisitor and I found
> that it does not consider billboards - i.e. the 
> osg::ComputeBoundsVisitor::apply(osg::Billboard&
> billboard) is missing. In effect, the osg::ComputeBoundsVisitor does not
> consider the pivot position stored in osg::Billboard::_positionList.
>
> Is this design intentional? If not, then how would you propose fixing this
> issue?
>

This is a design/implementation bug, looking that the implementation it's
clearly too simple and misses the special case of handling osg::Billboard.

To fix the bug a ComputeBoundVisitor::apply(osg::Billboard&) is required,
the implementation of this new method would need to iterator through the
_positionList and the drawables associated with each position and account
for the full rnage of potistions that are possible for each drawables
bounding box given the possible rotation and translation required.  The
easiest way to do this would be to use the diameter of each drawable
child's bounding box for the x,y and z extents.

I am not in a position to be able to write a fix right away as I have other
tasks to complete, but if you can't get to it hopefully next week I'll have
a chance to look at it.

Cheers,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] ComputeBoundsVisitor does not consider Billboards

2017-10-20 Thread Guy Volckaert
Hi,

I'm having problem with the osg::ComputeBoundsVisitor and osg::Billboards. In 
essence, the osg::ComputeBoundsVisitor does not consider the pivot position of 
the facing billboard. For example, let say I have a simple model that contains 
a single facing quad billboard (like a tree) located at (20, 20, 0) with a 
dimension of (10, 0, 10). I would expect the osg::ComputeBoundsVisitor to 
calculate a scene bounding box of min(15, 20, 0) max(25, 20, 10). However, what 
I seem to get instead is min(-5, 0, 0 ) max( 5, 0, 10 ). 

My investigation led me to review osg::ComputeBoundsVisitor and I found that it 
does not consider billboards - i.e. the 
osg::ComputeBoundsVisitor::apply(osg::Billboard& billboard) is missing. In 
effect, the osg::ComputeBoundsVisitor does not consider the pivot position 
stored in osg::Billboard::_positionList.

Is this design intentional? If not, then how would you propose fixing this 
issue?

Thank you!

Cheers,
Guy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72214#72214





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org