Thanx...

I figured out what the problem was: there was no problem... but I had the
material not set to null, thus
I saw my objects with the color set in diffusecolor of the material node....

thanks anyway...

michy

Dongming Zhang wrote:

> Hi, Michael,
>
> I don't know exactly what your problem is, but
> one thing may help, that is you may not get
> what you want if you have a light object turned on somewhere.
> Please check the "ColoringAttributes Object" sectoin
> of the j3dguide. To see the effect of color change,
> you have to either turn off the light or set the material
> object to null.
>
> Hope this can help,
>
> Dongming Zhang
>
> -----------------------------------------
> Dongming Zhang
> Analyst/Senior Programmer
> Interactive Network Technologies, Inc.
> Phone: 713-975-7434  Fax: 713-975-1120
> Email: [EMAIL PROTECTED]
> WWW  : http://www.int.com
> -----------------------------------------
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Michael
> > Wilimsky
> > Sent: Wednesday, March 03, 1999 9:21 AM
> > To: Java3d
> > Subject: [java3d] changing appearance attributes during life-cycle
> >
> >
> > I want to change the color in coloringattributes of shape, which is part
> > of a life scenegraph...
> >
> > I set the capabilities of appearance, coloringattributes and shape
> > accordingly:
> >
> > shape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
> > shape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
> >
> > colattr.setCapability(ColoringAttributes.ALLOW_COLOR_READ);
> > colattr.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE);
> >
> > and...
> >
> > app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
> > app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
> >
> >    Appearance app = shape.getAppearance();
> >    ColoringAttributes colattr = app.getColoringAttributes();
> >    Color3f color = new Color3f();
> >    colattr.getColor(color);
> >    JColorChooser cc = new JColorChooser();
> >    Color newcol = cc.showDialog(this, "Choose Color", new Color(color.x,
> > color.y, color.z));
> >    float r = newcol.getRed()/256f;
> >    float g = newcol.getGreen()/256f;
> >    float b = newcol.getBlue()/256f;
> >    colattr.setColor(new Color3f(r, g, b));
> >    app.setColoringAttributes(colattr);
> >    shape.setAppearance(app);
> >
> > but the code does not yield the desired result...
> >
> > can someone give me a hint? (I already compared the references of the
> > shape-instance... it is the same at any
> > time during execution of the app)
> >
> > so I have to call a kind of refresh-routine for the scenegraph after
> > modifying the color?
> >
> > michy
> >
> > =====================================================================
> > To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> > Java 3D Home Page: http://java.sun.com/products/java-media/3D/
> >

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to