Hi,

I'm setting the shape in the PickCanvas utility as a cylinder ray. The
origin point and the direction is taken from the default PickCanvas shape(ie
PickConeRay). But it is not picking the point in the correct direction. I'm
attaching the code, please see if the direction has to be set to something
else.
I'm using OrbitBehaviour in the application which is attached to
ViewingPlatform.

Thanks in advance,

Nitin

<<CODE>>-------

                PickCanvas pickCanvas = new PickCanvas(canvas3D, m_locale);
                pickCanvas.setMode(PickTool.GEOMETRY_INTERSECT_INFO);
                pickCanvas.setTolerance(1.0f);
                pickCanvas.setShapeLocation(me);

                Point3d p3d = new Point3d();
                Vector3d v3d = new Vector3d();

                canvas3D.getPixelLocationInImagePlate(mouseEvent.getX(),
mouseEvent.getY(), p3d);
                ((PickConeRay)pickCanvas.getPickShape()).getDirection(v3d);

                Transform3D temp = new Transform3D();
                canvas3D.getImagePlateToVworld(temp);
                temp.transform(p3d);

                pickCanvas.setShapeCylinderRay(p3d, v3d, 0.02);
                PickResult pickResult = pickCanvas.pickClosest();

                if (pickResult != null)
                {
                    PickIntersection pickIntersection =
pickResult.getClosestIntersection(p3d);

                    if (pickIntersection != null)
                    {
                        Point3d p3d1 = new Point3d();
                        p3d1 =
pickIntersection.getClosestVertexCoordinates();

                        System.out.println("p3d1 : " + p3d1);
                    }
                }


===========================================================================
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