Hallo Ian,

your application runs in that exception, because the pick branch group
contains at least one shape, which hasn't set the necessary capabilities. I
took a look at your code and found following:

MouseOverCityBehavior behavior = new MouseOverCityBehavior(canvas, objRoot,
new BoundingSphere(), box, cityName);

that means, objRoot is the pick branch and it contains the earth too. I
guess the earth object will cause the exception.

In respect to performance issues, the pick branch should contain as less
objects as possible. Therefore you can - for example - use the city group as
pick root. Furthermore i am wondering, why  you insert a pick behavior for
each city. Perhaps it would be much more efficient to use only one behavior.
This (single) behavior can indicate a picked shape either by reference or
you can set the city name in the field 'userdata' of node.

Good luck!
Oliver

From: Ian Wojtowicz <[EMAIL PROTECTED]>
Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Geometry-based Picking
Date: Sun, 29 Feb 2004 22:56:51 -0800

Hello everyone. I was hoping someone might be able to offer some advice
on a difficulty I am experiencing. I am currently trying to get
geometry-based picking to work in a Java3D 1.3 application, but I keep
running into the following exception:

       javax.media.j3d.CapabilityNotSetException: Shape3D: no capability
to
allow intersect

This shouldn't be happening as I am setting the appropriate
capabilities in my geometries:

       box.setCapability(Geometry.ALLOW_INTERSECT);
       box.setCapability(Primitive.ENABLE_GEOMETRY_PICKING);

If anyone has managed to use geometry-based picking in a Java3D app
before, I'd love to hear from you. I've attached my source code, in
case you're interested.

Cheers.

Ian


=========================================================================== 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". << WorldViewer.java >>

_________________________________________________________________ E-Mails sind zu unpersönlich? Mit einer Webcam wird der MSN Messenger zum Bildtelefon! http://www.msn.de/messenger Jetzt kostenlos downloaden und mitmachen!

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