When you create your appearance for your shape, you
have to set some capability bits, for example :

Appearance app = new Appearance();

app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);

app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);

  Color3f objColor = new Color3f(Color.red);
            ColoringAttributes ca = new
ColoringAttributes();
            ca.setColor(objColor);
            app.setColoringAttributes(ca);
....
Shape3D myShape = new Shape3D(myGeometry, app);

If you want to change the color appearance in a
keyPressed behaviour :

.....
public void processStimulus(Enumeration wakeup)
{
.....
Appearance shapeAppearance;

shapeAppearance = myShape.getAppearance();
ColoringAttributes shapeColoring =
shapeAppearance.getColoringAttributes();

ColoringAttributes caGreen =
        new ColoringAttributes(new
Color3f(Color.green), ColoringAttributes.FASTEST);

shapeAppearance.setColoringAttributes(caGreen);

....
}


You have to pass myShape in the constructor of the
behaviour or make the object visible outside the
behaviour class




__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

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