For the shape in the first post. I did another test.

I added one more function (as below) into my WindowPickBehavior class. This
function checks if the left most point (-0.9779, 0, 0.397007) is inside the
PickShape or not?

I run my code and found if my pick window encloses the left most point on the screen, 
the function tells me the left most point is indeed inside the
PickShape, which means the PickTool should get an intersection with this
shape, right? but it fails sometimes as I decribed in my first post.

I suspect the picking utility function in Java3D did sth wrong or I am wrong?  Can any 
one verify this???  Many thanks! ---white


    /**
     * My test of intersection. If the point is inside the Picking Shape,
     * return true, otherwise, return false
     *
     * @param  planes  The array of planes function of the PickShape
     */
    private boolean myIntersectTest(Vector4d []planes) {
        Point3d pt = new Point3d(-0.9779, 0, 0.397007);

        Shape3D shape = (Shape3D)(branchGroup.getChild(0));

        Transform3D t = new Transform3D();
        shape.getLocalToVworld(t);

        t.transform(pt, pt);

        /*
        double res;
        for (int ii=0; ii<planes.length; ii++) {
            res = planes[ii].x*pt.x + planes[ii].y*pt.y + planes[ii].z*pt.z +
                            planes[ii].w;
            if (res > 0)
                return false;
        }

        return true;
         */

        BoundingPolytope bounds = new BoundingPolytope(planes);

        return bounds.intersect(pt);

    }

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to