I've developed a class that extends     com.sun.j3d.utils.picking.behaviors.PickRotateBehavior.

I developed an updateScene method for the new class, using as a model code I found on the web for PickHighlightBehavior.

I need to find the closest vertex of the object hit by the current pickray.

Thanks,

Mark


When when I change "false" to "true" in the second, inner if statement, the system says that    
capability is not set to allow_read_geometry
in the statement
               
PickIntersection pickIntersection = pickResult.getIntersection(0);
even though the node does have those capabilities and I changed the capability of all my Shape3d objects to allow geometry read and write.

When I insert the following code before that statement, the same error occurs at the new statement:
           int numIntersections = pickResult.numIntersections();

  public void updateScene(int xPos, int yPos) {
    super.updateScene(xPos, yPos);
    PickCanvas pickCanvas = this.pickCanvas;
    PickResult pickResult = pickCanvas.pickClosest();
    if (pickResult != null) {
      if (false) {
        PickShape pickShape = pickCanvas.getPickShape();     
        PickIntersection pickIntersection = pickResult.getIntersection(0);
        Point3d point3d = pickIntersection.getClosestVertexCoordinatesVW();
        Point3d intersection = pickIntersection.getPointCoordinates();
        System.out.println(0 + " Vertex=" + point3d +  " Inter=" + intersection);
     }
  }

Mark Tapia
Research Scientist
Department of Architecture
Massachusetts Institute of Technology
Phone: 1.617.253.1721   Fax:    1.617.253.8221

Website: http://architecture.mit.edu/house_n/web/people/principal.htm

Reply via email to