Hi all!
In my application, i used to pick some shape3d with : ... geometry.setCapability(Geometry.ALLOW_INTERSECT); shape.setGeometry(geometry); PickTool.setCapabilities(shape, PickTool.INTERSECT_FULL); shape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE); ...
and with this pickbehavior
public class PickBehavior extends PickMouseBehavior implements MouseListener {
private PickCanvas pickCanvas;
public PickBehavior(Canvas3D canvas, BranchGroup root, Bounds bounds) { super(canvas, root, bounds); canvas.addMouseListener(this); this.setSchedulingBounds(bounds); root.addChild(this); pickCanvas = new PickCanvas(canvas, root); pickCanvas.setTolerance(0.05f); pickCanvas.setMode(PickTool.GEOMETRY); }
public void updateScene(int xpos, int ypos) { PickResult pickResult = null; Shape3D selectedShape; try { pickCanvas.setShapeLocation(xpos, ypos); pickResult = pickCanvas.pickClosest(); } catch (Exception e) { return; //ce n'est pas un shape selectionnable } if (pickResult != null) { selectedShape = (Shape3D) pickResult.getNode(PickResult.SHAPE3D); select(selectedShape); } }
...
}
this works very fine, but if I want to change the geometry, with shape.setGeometry() shape becomes not pickable, and other shapes near it too... I think that there is a method to say "Geometry has changed, Node has changed, please update!" but I 've not found it...
Thanks for your help!
Damien Maillet IRD CGG [EMAIL PROTECTED]
=========================================================================== 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".