Hello all!
I'm trying to develop a general (don't know why this class does not
exists yet) to obtain the 3d object being picked in a mouse click. Name
it PickSelectBehavior.
First, there is a bug in the javadoc :
�
public abstract class PickMouseBehavior
extends Behavior
Base class that allows users to adding picking and mouse manipulation to
the scene graph (see PickDragBehavior for an example of how to extend
this base class). This class is useful for interactive apps.
�
The mentioned class PickDragBehavior does not exists ... Wich class want
to be referred?
My code is
public class PickSelectBehavior
extends PickRotateBehavior
{
public PickSelectBehavior(BranchGroup root, Canvas3D canvas, Bounds
bounds)
{
super(root,canvas,bounds);
}
public void updateScene(int x, int y)
{
if (currGrp != null)
System.out.println(currGrp.getUserData());
}
}
Note I using the no documented currGrp, and I'm not sure what is this. Or
when I have a PickResult or something like that.
My try always prints a NULL, so in a desesperate measure I do the
following marking on all the scene (abreviated)
Node p = objRoot;
while ( p != null )
p.setUserData("Hello");
p = p.getParent();
public void mark_all( Node p)
if ( p==null ) return ;
for (Enumeration e = g.getAllChildren() ; e.hasMoreElements() ;)
n = (Node) e.nextElement();
p.setUserData("Hello");
mark_all( n );
And allways, the currGrp !=null and .getUserData() == null.
Some ideas ? (or the source code from a PickMouseBehavior subclass!)
Thanks!
==========================================================================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".