Ian,
it works for me. Here's my code:
plane = new Shape3D();
PolygonAttributes pa = new PolygonAttributes();
pa.setPolygonMode(pa.POLYGON_FILL);
pa.setCullFace(pa.CULL_NONE);
pa.setBackFaceNormalFlip(true);
appearance.setPolygonAttributes(pa);
RenderingAttributes ra = new RenderingAttributes();
ra.setDepthBufferEnable(true);
appearance.setRenderingAttributes(ra);
plane.setAppearance(appearance);
plane.setGeometry(gi.getGeometryArray());
...and in another class:
Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
Color3f red = new Color3f(1f, 0f, 0f);
Color3f ambientRed = new Color3f(0.89f, 0.13f, 0.24f);
Color3f ambient = new Color3f(0.2f, 0.2f, 0.2f);
Color3f diffuse = new Color3f(0.2f, 0.2f, 0.2f);
Color3f specular = new Color3f(0.1f, 0.1f, 0.1f);
Color3f bgColor = new Color3f(0.16f, 0.48f, 0.72f);
// Create the branch group
BranchGroup branchGroup = new BranchGroup();
// Create a Transformgroup to scale all objects so they
// appear in the scene.
TransformGroup objScale = new TransformGroup();
Transform3D t3d = new Transform3D();
t3d.setScale(0.1);
objScale.setTransform(t3d);
branchGroup.addChild(objScale);
// Create the bounding leaf node
BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
BoundingLeaf boundingLeaf = new BoundingLeaf(bounds);
objScale.addChild(boundingLeaf);
// Set up the background
Background bg = new Background(bgColor);
bg.setApplicationBounds(bounds);
objScale.addChild(bg);
// Create the ambient light
AmbientLight ambLight = new AmbientLight(white);
ambLight.setInfluencingBounds(bounds);
objScale.addChild(ambLight);
// Create the directional light
Vector3f dir = new Vector3f(-1.0f, -1.0f, 1.0f);
Vector3f dir1 = new Vector3f(1.0f, 1.0f, 1.0f);
DirectionalLight dirLight = new DirectionalLight(white, dir);
dirLight.setInfluencingBounds(bounds);
objScale.addChild(dirLight);
DirectionalLight dirLight1 = new DirectionalLight(white, dir1);
dirLight1.setInfluencingBounds(bounds);
objScale.addChild(dirLight1);
Hope it helps,
Jure
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/