I think if you look at the tutorial (chapter 6) that all your lighting
questions will be answered.  You will find that Java 3D does not 'do'
shadows.

Find the Java 3D Tutorial "Getting Started with the Java 3D API" at
java.sun.com/products/javamedia/3d/collateral

good luck,
Dennis

Michael Allen Latta wrote:
>
> I have ambient light and directional light almost working but am unable to
> get point or spot lights to work.  The SphereMotion example seems to be the
> only one that uses them and I can not see what is different from what I am
> doing.  I am disturbed though by the lack of shadows.  Is the Java3D
> lighting model capable of showing shadows from light sources?  My current
> attempts almost light each surface independently which looks really
> unnatural.
>
> The API is certainly more approachable than RenderMan (my previous
> experience with 3D) but the results are starting to look limited.  I hope
> there are resolutions to this possible.
>
> The following are code snipits for the light creation and wall material
> creation from my program if anyone cares to look.
>
>  PointLight p1 = new PointLight();
>  p1.setEnable(true);
>  p1.setColor(new Color3f(1.0f, 1.0f, 1.0f));
>  p1.setPosition(0.0f, 0.0f, 0.0f);
>  p1.setAttenuation(1.0f, 0.0f, 0.0f);
>  p1.setBounds(bounds);
>  Transform3D t1 = new Transform3D();
>  t1.set(new Vector3d( 5.0, 5.0, 15.0));
>  TransformGroup tg1 = new TransformGroup(t1);
>  tg1.addChild(p1);
>
>  Appearance app = new Appearance();
>  PolygonAttributes pa = new PolygonAttributes();
>  pa.setCullFace(PolygonAttributes.CULL_BACK);
>  app.setPolygonAttributes(pa);
>  Color3f objColor = new Color3f(color[0], color[1], color[2]);
>  Material mat = new Material(objColor, black, objColor, white, 100.0f);
>  mat.setLightingEnable(true);
>  app.setMaterial(mat);
>  ColoringAttributes col = new ColoringAttributes();
> // col.setShadeModel(ColoringAttributes.NICEST);
>  app.setColoringAttributes(col);
>
> ----- Original Message -----
> From: Michael Allen Latta <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 17, 2000 4:28 PM
> Subject: [JAVA3D] Lighting
>
> > I just started to work with Java3D and am having some problems with
> > lighting.  The Spec is very short on description of the lighting model.
> Any
> > pointers or additional material would be appreciated.  I can get the scene
> > lighted by seting directonal lights with a gray color at several points,
> but
> > it seems very easy to washout the specified colors on surfaces.  I would
> > really like to define a material once and define the color on the surface.
> >
> > Michael Latta
> >
> >
> ===========================================================================
> > 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".
> >
>
> ===========================================================================
> 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".

--
-----
Dennis J Bouvier
[EMAIL PROTECTED]

===========================================================================
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".

Reply via email to