Bob,
You're in luck, because I have also been trying to get a "feel" for the
parameters and have written pretty much exactly what you describe for my
book (in progress).
I have attached the example ("LightTest"). It creates a simple scene
composed from some spheres and 4 lights: point, directional, ambient and
spot.
It creates a pop-up frame for each light with some (basic!) UI to allow you
to control all the light parameters for each type of light. In addition the
direction of the directional light is shown within the scene using a large
cone, and the position of the point and spot lights shown using a ColorCube.
Basic, but it does the trick.
I'm afraid I cannot release the source code yet, but I have attached the
ZIPed class files. You will also need J3dTree and the attached
Java3dApplet.class in your classpath to run the example. The main
entry-point is within LightTest.
You can download J3dTree here:
http://www.tornadolabs.com/News/J3dTree_Home/j3dtree_home.html
Once you get your lights about right I can give you the details of the
materials I used. Also, the scene is fairly small, about +- 8 units in each
dimension.
Best of luck - I hope you find it useful!
Sincerely,
Daniel Selman
[EMAIL PROTECTED]
http://www.tornadolabs.com
-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Bob Gray
Sent: 29 November 1999 09:36
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Color and Lighting
I never seem to be able to get my lighting in Java 3D just right.
I have a bunch of polyhedra, all different colors. When I rotate
them around, the polyhedra faces which are perpendicular to my viewing
direction turns white. Too much lighting or something. Yet the over all
appearance of the polyhedra is way too dark.
I have an AmbientLight set to
lightA.setColor(new Color3f(0.6f, 0.6f, 0.6f));
and a directional light always in the direction of viewing.
lightD1.setColor(new Color3f(0.75f, 0.75f, 0.75f));
I set my appearance and material properties for the polyhedra
theMaterial.setDiffuseColor(0.0f, 0.80f, 0.0f);
theMaterial.setLightingEnable(true);
I need to know how to set the material properties and the lighting
properties to have bright, sharp, polyhedra without "white out".
Is there a program that lets you try different lighting settings?
Are there general rules of thumb for lighting? I've read the Tutorial
several times. But I never get a good "feel" for the right parameter
settings.
And there are several other material parameters that could be set like
setAmbientColor, setEmissiveColor, setShininess, setSpecularColor
Too many to play with. Does anyone how some settings already figured
out that I could try??
There should be a program that lets you move knobs to change all these
parameters
so you can see the effects and to help you get the lighting you want
quickly.
Bob Gray
===========================================================================
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".
LightTest.zip
Java3dApplet.class