I have implemented a utility for picking
points on the surface of a mesh. Once a point
has been placed it can be dragged over the
surface until it is in the correct location.

This works fine 99% of the time but occasionally
the point, whilst being dragged, "jumps" to
an incorrect location on the mesh, and then
returns to the correction location as the mouse
is dragged futher.

Given that the implementation works most of
the time I suspect this might be a bug in the
J3D picking utilities. Has anyone else witnessed
this problem and if so is there a solution?

The key points in the implementation are ...

When a model is loaded it's capabilities are set for picking
------------------------------------------------------------

    PickTool.setCapabilities(model,PickTool.INTERSECT_FULL);

Creation of a PickCanvas
------------------------

    pickCanvas = new PickCanvas(canvas3D, modelBranchGroup);
    pickCanvas.setMode(PickTool.GEOMETRY_INTERSECT_INFO);
    pickCanvas.setTolerance(4.0f);

The pick callback function itself
---------------------------------

  private void doPick(MouseEvent e) {
    if (pickCanvas!=null) {
      pickCanvas.setShapeLocation(e);
      PickResult result = pickCanvas.pickClosest();
      if (result!=null) {
        result.setFirstIntersectOnly(true);
        PickIntersection intersect=result.getIntersection(0);
        if (intersect!=null) {
          Point3d p=intersect.getPointCoordinates();
          ......
          ......
        }
      }
    }
  }

------------------------------
Dr. Anthony Ashbrook
+44 131 662 4153
[EMAIL PROTECTED]
http://www.anthonyashbrook.net
------------------------------

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