Hi John,
I have used lighting as you see :
BoundingSphere bound=new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 50 );
Color3f lightColor = new Color3f (1.0f, 1.0f, 1.0f);
Vector3f light1Direction = new Vector3f (0.0f, 0.0f, 0.0f);
DirectionalLight light1 = new DirectionalLight (lightColor, light1Direction);
light1.setInfluencingBounds (bound);
branchgroup.addChild (light1);
AmbientLight ambientLightNode = new AmbientLight (lightColor);
ambientLightNode.setInfluencingBounds (bound);
branchgroup.addChild (ambientLightNode); */
Vector3f light1Direction = new Vector3f (0.0f, 0.0f, 0.0f);
DirectionalLight light1 = new DirectionalLight (lightColor, light1Direction);
light1.setInfluencingBounds (bound);
branchgroup.addChild (light1);
AmbientLight ambientLightNode = new AmbientLight (lightColor);
ambientLightNode.setInfluencingBounds (bound);
branchgroup.addChild (ambientLightNode); */
cheers,
Saeed
John Wright <[EMAIL PROTECTED]> wrote:
John Wright <[EMAIL PROTECTED]> wrote:
Saeed,
Perhaps you don't have a light source in your scene?
- John Wright
Starfire Research
Saeed Ansari wrote:
> Hi,
> I have used material, but it doesn't work and all of shapes are dark.
> Below is my code :
>
> Appearance appearance=new Appearance();
> appearance.setColoringAttributes (new ColoringAttributes (new Color3f(2.0f, 1.0f, 3.5f),1));
> appearance.setPolygonAttributes(polyAtt);
> Material mat=new Material();
> mat.setAmbientColor(new Color3f(0.0f,0.0f,1.0f));
> mat.setDiffuseColor(new Color3f(0.7f,0.7f,0.7f));
> mat.setSpecularColor(new Color3f(0.7f,0.7f,0.7f));
> appearance.setMaterial(mat);
> shape.setAppearance(appearance);
>
> Is something forgotten to add ?
>
> Regards,
> Saeed
===========================================================================
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".
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone. =========================================================================== 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".