Hi,

take a look at the demos:
- demo/java3d/PickTest
- demo/java3d/PickTest3D
- demo/java3d/TickTockPicking

the last is the biggest.

Basic idea:
*************************************************
import com.sun.j3d.utils.behaviors.picking.*;
...

createSceneGraph
...

objTrans.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
...

Shape3D shape;
shape = (Shape3D) pickScene.pickNode(pickScene.pickClosest(xpos, ypos,
          PickObject.USE_BOUNDS),
          PickObject.SHAPE3D);
***************************************************

Hope that helps,

J�rg

On Tue, 3 Aug 1999, Juergen Neubauer wrote:

> Hello,
>
> I am using the Vrml97Viewer to load a VRML-Model.
>
> Example: DEF Box and DEF Cone (and DEF ViewpointBox) in one VRML-file.
>
> What I want to do:
>
> When loaded, I want to get feedback about what part I have clicked on.
>
> And/or click on a button outside the 3D Canvas and and move to the Box.
> (whith a viewpoint for the Box defined)
>
> So far: with scene.getNamedObjects I can look for Box, Cone and
> ViewpontBox.
>
> But what would be the right code to get:
> System.out.println("Box is clicked !" + ...); ?
>
> Next step would be to setObjViewpoint to ViewpointBox, when clicked on
> Box to simulate a Zoom.
> (I think I may have solved this step already.)
>
> Thanx for any hint
>
> -Juergen.
>

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