Thanks, my fellow graphics member, Manu!
However, it still complains with the same exception. (I even tried
PickTool.setCapabilities method.)
Can someone share an excerpt of code that has the picking a 3d object working?
Thank you,
Kovalan
Ps. Mine is as follows:
// Main:
pickCanvas = new PickCanvas(canvas, scene);
pickCanvas.setMode(PickTool.GEOMETRY );
pickCanvas.setTolerance(4.0f);
canvas.addMouseListener( new MouseClicked() );
// 3d Object creation
box.setCapability( Geometry.ALLOW_INTERSECT );
box.getShape(Box.BACK).setCapability( Geometry.ALLOW_INTERSECT );
box.getShape(Box.BOTTOM).setCapability( Geometry.ALLOW_INTERSECT );
box.getShape(Box.FRONT).setCapability( Geometry.ALLOW_INTERSECT );
box.getShape(Box.LEFT).setCapability( Geometry.ALLOW_INTERSECT );
box.getShape(Box.RIGHT).setCapability( Geometry.ALLOW_INTERSECT );
box.getShape(Box.TOP).setCapability( Geometry.ALLOW_INTERSECT );
// MouseClicked
class MouseClicked extends java.awt.event.MouseAdapter {
public void mouseClicked(java.awt.event.MouseEvent e) {
super.mouseClicked(e);
PickResult[] results = null;
try {
pickCanvas.setShapeLocation(e);
results = pickCanvas.pickAll();
}
catch ( Exception err ) {
err.printStackTrace();
System.out.println( "Err: Not pickable??" );
}
if ( results != null )
System.out.println( "Picked!" );
else
System.out.println( "Nothing happened!" );
}
}
Manu Eapen Varghese <[EMAIL PROTECTED]> on 09/20/2000 07:23:10 PM
Please respond to Discussion list for Java 3D API <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Kovalan Muniandy/Orincon)
Subject: Re: [JAVA3D] Shape3D.intersect, how to turn on on?
Hi Kovalan,
If you want to pick using geometry (USE_GEOMETRY), you have to add the
capability Geometry.ALLOW_INTERSECT to the appropriate Geometry object (I
guess this is causing the "no capability to allow intersect" exception).
Regards,
Manu.
On Wed, 20 Sep 2000, Kovalan Muniandy wrote:
> Hi there!
>
> I get the following exception. Which capability field do I have to use on the
> Shap3d object to make it intersectable?
>
> Thank you,
>
> Kovalan
>
> javax.media.j3d.CapabilityNotSetException: Shape3D: no capability to allow
> intersect
> at javax.media.j3d.Shape3D.intersect(Shape3D.java:434)
> at com.sun.j3d.utils.picking.PickTool.pickGeomAll(PickTool.java:620)
> at com.sun.j3d.utils.picking.PickTool.pickAll(PickTool.java:431)
> at
>
com.orincon.bluejai.gui.LoginVizApp$MouseClicked.mouseClicked(LoginVizApp.java:312)
>
> ===========================================================================
> 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".
>
===========================================================================
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".
===========================================================================
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".