1. The Primitive ctor() turns on ENABLE_PICK_REPORTING by default. Nuttin to do here.
2. A Cone Primitive is made up of two Shape3Ds, one for the BODY, and one for the CAP. By specifying ENABLE_GEOMETRY_PICKING when invoking its ctor(), it should go thru all its children (CAP & BODY) and set invoke their (Shape3D) methods setCapability(Shape3D.ALLOW_GEOMETRY_READ), which indeed it does (see com/sun/j3d/utils/geometry/Cone.java in the utils sources). Cone inherits its setCapability() from javax.media.j3d.Group, so I can't verify that it's doing the right thing on its (Group's) children, as the javax.media.j3d sources are not avail to me. But I'm damn sure it does! 3. Shape3D instances own a bunch of Geometries they are made of. As Shape3D also lives in javax.media.j3d, I cannot tell either whether it's doing the right thing. But I'm damn sure it does, too! To wrap up, the only thing you had to do, you already did, that is ENABLE_GEOMETRY_PICKING ! Of course, that doesn't help much, as your code coughs-up that darn exception! Are you sure it's a Cone instance it is choking on? If I were you, I'd go thru your offending mouseClicked() method with a debugger and take a peek at the objects that are involved! H. p.s. I admit, that capability setting business is a confusing one! ----- Original Message ----- From: "Brobbey,Isaac (neuron)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 10, 2003 2:55 PM Subject: [JAVA3D] Capability Not Set Exception > Dear all: > > > this is my code for creating a Cone, > > > Cone cone = new Cone(coneRadius, coneHeight, > Cone.ENABLE_GEOMETRY_PICKING|Cone.GENERATE_NORMALS|Cone.ENABLE_APPEARANCE_MO > DIFY|, appearance); > > enumKids(cone); > cone.setUserData((Object) p); > enumKids(coneTGB) > coneTGB.addChild(cone); > return coneTGB; > > my question is should i do > > cone.setCapability(Primitive.ENABLE_GEOMETRY_PICKING); > > cone.setCapability(Shape3D.ALLOW_GEOMETRY_READ); > > cone.setCapability(Geometry.ALLOW_INTERSECT); > > i may sound stupid, but i am really confused on this thing. > > > > this is the error that i am getting, > > javax.media.j3d.CapabilityNotSetException: Shape3D: no capability to get > geometry at javax.media.j3d.Shape3D.numGeometries(Shape3D.java:398) > > at com.sun.j3d.utils.picking.PickResult.storeGeometr(PickResult.java:502) > at com.sun.j3d.utils.picking.PickResult.generateIntersection(PickResult.java > > > thanks for any help, > > > > Isaac > > =========================================================================== > 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".
