> From: "David Grace" <[EMAIL PROTECTED]>
>
> I have displayed a Cone with:
> Cone cone = new Cone();
>
> and then tried to allow modification of its appearance with both:
> cone.setCapability(Primitive.ENABLE_APPEARANCE_MODIFY); and
> cone.setPrimitiveFlags(Primitive.ENABLE_APPEARANCE_MODIFY);
>
> (I'm not sure which one of these is appropriate)
>
> but when I call cone.getAppearance() or cone.setAppearance() I get an error at
> runtime that says CapabilityNotSetException.
All the utility primitives return a Group which holds the elements of the
primitive. For example, a Cone actually has two Shape3Ds, one for bottom and
the other for the sides. So Cone.setCapabilty() changes the cap bits on the
group which holds the Shape3Ds, not the Shape3d's.
Try setting the ENABLE_APPEARANCE_MODIFY flag in the the constructor for Cone.
This will set the cap bits correctly on the Shape3Ds. You should then be able
to call Cone.setAppearance() without an exception.
Doug Gehringer
Sun Microsystems
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/