Hi Judd,

I've just tried

  osgpick lz.osg

And zooming into the trees and attempting picking is showing no
intersections results where I'd expect.  Reviewing the relevent code
in IntersectionVisitor.cpp suggests that there is no special code for
handling the local model transforms that are required for billboards,
the so the answer is looks to be that even 2.6 hasn't had this problem
addressed. The relevant code is:

void IntersectionVisitor::apply(osg::Billboard& billboard)
{
    if (!enter(billboard)) return;

    for(unsigned int i=0; i<billboard.getNumDrawables(); ++i)
    {
        intersect( billboard.getDrawable(i) );
    }

    leave();
}

Looking at the old IntersectVisitor.cpp code shows that it does have
some proper matrix code in there, which could probably copied across
into the IntersectionVisitor:



Robert.
void IntersectVisitor::apply(Billboard& node)
{
    if (!enterNode(node)) return;

    // IntersectVisitor doesn't have getEyeLocal(), can we use
NodeVisitor::getEyePoint()?
    const Vec3& eye_local = getEyePoint();

    for(unsigned int i = 0; i < node.getNumDrawables(); i++ )
    {
        const Vec3& pos = node.getPosition(i);
        osg::ref_ptr<RefMatrix> billboard_matrix = new RefMatrix;
        node.computeMatrix(*billboard_matrix,eye_local,pos);

        pushMatrix(billboard_matrix.get(), osg::Transform::RELATIVE_RF);

        intersect(*node.getDrawable(i));

        popMatrix();

    }

    leaveNode();
}

Try merging this code in. If it works out just post the changes to
osg-submissions.  Although it won't be in 2.6.0, this fix could
probably make it into later 2.6.x maintenance releases.

Robert.


On Mon, Aug 11, 2008 at 4:03 PM, Judd Tracy <[EMAIL PROTECTED]> wrote:
> The LineSegementIntersector in osg 2.4 does not work properly with
> Billboards.  Is there a fix in the SVN or that anyone else might have
> submitted that exists for this.  I have searched the SVN and as far as I can
> tell it has not been addressed.  Any help would be appreciated.
>
> Judd
> _______________________________________________
> 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