Hello.

I'm new to Java3D and I'm trying to do some stuff with picking
mechanism. I've extended the MouseBehaviorApp example in order to add
picking capabilities. I have two cubes with picking enabled, and when a
cube is picked, it renders in wireframe mode. I've extended the
PickMouseBehavior class. The updateScene method is like this:

 public void updateScene(int xpos, int ypos) {
        PickResult pickResult[], pickNode;
        Shape3D shape = null, theShape = null;

        pickCanvas.setShapeLocation(xpos, ypos);

        pickResult = pickCanvas.pickAllSorted();
        if (pickResult != null) {
            for(int i=0; i<pickResult.length; i++) {
                pickNode = pickResult[i];
                shape = (Shape3D) pickNode.getNode(pickNode.SHAPE3D);
                if(shape!=null) {
                    String name = (String) shape.getUserData();
                    System.out.println("Picked " + name);
                    if(i==0)
                        theShape = shape;
                }
            }
        }

        if (oldShape != null){
            oldShape.setAppearance(savedAppearance);
        }
        if (theShape != null) {
            savedAppearance = theShape.getAppearance();
            oldShape = theShape;
            theShape.setAppearance(highlightAppearance);
        }
    }

   When a cube is behind the other (always the same cube and partially
showed) and you pick the nearest cube is the furthest cube which is
selected. I've tried to browse search the mail archive but I can't
establish a connection. Sorry for posting to the list before taking a
look to the archives.

Does anybody know the reason of this behaviour?

Any help would be appreciated.

Thanx.

--
-------------------------------------------------------------------------
Joaqu�n Casillas Mel�ndez(Quino), R+D Engineer at iSOCO
Intelligent Software Components, S.A. http://www.isoco.com
Addr. iSOCOVal: Profesor Beltr�n B�guena, 4, oficina 305, 46009 Valencia
Voice: +34 96 346 71 43 Fax: +34 96 348 28 94
                                                        Powered by Linux!

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