Skip to Main Content

Scene appearance problem

843799Jul 23 2001 — edited Jul 25 2001
Hi, all

I built some polyhedrons using IndexedTriangleArray, the normal for each
vertex point is (0.0, -1.0, 0.0). I used the following code to set the
appearance:

PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setBackFaceNormalFlip(true);

Appearance app = new Appearance();
app.setPolygonAttributes(pa);

I also applied the lights and MouseZoom to my TransformGroup object using
the following code:

//add AmbientLight and DirectionalLight to objScale
AmbientLight lightA = new AmbientLight(new Color3f(0.2f,0.2f,0.2f));
lightA.setInfluencingBounds(new BoundingSphere());
objScale.addChild(lightA);

DirectionalLight lightD1 = new DirectionalLight();
lightD1.setInfluencingBounds(new BoundingSphere());
Vector3f direction = new Vector3f(0.0f, -1.0f, 0.0f);
direction.normalize();
lightD1.setDirection(direction);
lightD1.setColor(new Color3f(0.0f, 1.0f, 0.0f));
objScale.addChild(lightD1);

MouseZoom behavior2 = new MouseZoom();
behavior2.setTransformGroup(objScale);
objScale.addChild(behavior2);
behavior2.setSchedulingBounds(bounds);

Now my trouble is, if I keep zooming in, I can not see some sides of the
polyhedrons. It seems that the normals changed. I do not have this trouble
if I keep zooming out. I am not sure if this is normal, lighting, or appearance
problem.

Any help will be highly appreciated.

Gaoming
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Aug 22 2001
Added on Jul 23 2001
2 comments
34 views