Using the Appearance object. We must first import the class
- import javax.media.j3d.Appearance
/** Begin of sample codes */
Appearance textAppear = new Appearance();
ColoringAttributes textColor = new ColoringAttributes();
textColor.setColor(1.0f, 0.0f, 0.0f);
textAppear.setColoringAttributes(textColor);
textAppear.setMaterial(new Material());
ColoringAttributes textColor = new ColoringAttributes();
textColor.setColor(1.0f, 0.0f, 0.0f);
textAppear.setColoringAttributes(textColor);
textAppear.setMaterial(new Material());
/** End of sample codes */
As you can see above, the setColor method interprets the 3 floats together as an RGB colour.
The appearance object actually defines all rendering state, like material, textures as well.. more study will be done.


No comments:
Post a Comment