Hello all,

I'm using SimpleUniverse and PickCanvas together and running into some
difficulties.  I've condensed all of the relevant code below.

    public class Java3DWorld extends Canvas3D
    {
       private SimpleUniverse simpleUniverse;
       private PickCanvas pickCanvas;

       public Java3DWorld()
       {
        ...

        pickCanvas = new PickCanvas(simpleUniverse.getCanvas(),
simpleUniverse.getLocale());
            pickCanvas.setMode(PickCanvas.GEOMETRY);
            pickCanvas.setTolerance(4.0f);

            //create mouse listener
            addMouseListener(
              new MouseAdapter()
              {
                public void mousePressed(MouseEvent event)
                {
                  pickCanvas.setShapeLocation(event);
                  PickResult result = pickCanvas.pickClosest();

                  if (result != null)
                  {
                //simply print the event location for now until get picking
working
                        System.out.println(event.getX());
                        System.out.println(event.getY());
                  }
                }
              }
            );
       }

       public void AddBranchGroup(BranchGroup bg)
       {
         pickCanvas.setCapabilities(bg, PickCanvas.INTERSECT_TEST);
         simpleUniverse.addBranchGraph(bg);
       }

        ...
    }

My driver creates BrachGroups which consist of a Shape3D object and they are
passed to Java3DWorld via AddBranchGroup().  Before adding the PickCanvas
class to my code, I could add objects at will and they rendered correctly.
Now I get an "Improper node type" error during the first call to
AddBranchGroup in the setCapabilities() function call.  The node type I'm
passing in is a BranchGroup that contains a primitive Shape3D sphere.

Anyone got any advice or see a bug that I've overlooked?  Thanks very much.

Brian M.

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