Hi Ashish,

a fast (but dirty) way to do this would be the following.

Save the center of the object with the shape.
This can be done by setting the user data field of a Shape3D using
setUserData();
At creation time of the shapes you (hopefully) know the coordinates centers of
the objects!!)
    Point3f center = new Point3f( <some coordinates> );
    Shape3D shape = <some shape creation>
    shape.setUserData( center );

After you have done this you facilitate the PickTool or PickCanvas class
provided by the com.sun.j3d.utils.picking
package.
PickCanvas pickCanvas;
pickCanvas = new PickCanvas( aCanvas3D, sceneBranchGroup );
pickCanvas.setMode( PickTool.GEOMETRY );
pickCanvas.setTolerance( 3 );

    PickResult pickResult = pickCanvas.pickClosest();

    if ( pickIntersection != null ) {

       node = pickResult.getObject();

        // here you get your center of the picked objects
        Point3f center = node.getUserData();

      }


I skip the infrastucture that collects the objects picked after one another.
This is your part.

Hope this helps!

Cheers,
Karsten

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