> From: Kynn Jones <[EMAIL PROTECTED]>
>
> Found the answer (in the Archive, as it turns out). Changing
>
> Box box = new Box(0.2f, 0.2f, 0.2f, app);
> box.setCapability(Primitive.ENABLE_APPEARANCE_MODIFY);
>
> to
>
> Box box = new Box(0.2f, 0.2f, 0.2f,
> Primitive.ENABLE_APPEARANCE_MODIFY,
> app);
>
> got rid of the error. Amazing, but WHY? Why doesn't setCapability
> work as expected?
The problem is that Box is a utility class, it extends Primitive which extends
Group. A Primitive is a Group which holds one or more Shape3Ds. For a Box
there is a single Shape3D, but for a Cylinder there are three, one for the body
and two for the top and bottom.
So when you call Box.setCapability() you are really calling setCapability() on
the the Group that holds the Shape3D. When you initialize the Box with the
ENABLE_APPEARANCE_MODIFY flag, the ALLOW_APPEARANCE_WRITE capability is set on
the Shape3D that holds the Box geometry. Alternatively, you could call
setCapability() on the children of the Primitive, but it is easier to work with
the flags in the constructor.
Doug Gehringer
Sun Microsystems
===========================================================================
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".