>
> > My problem is to have lighting enabled AND to see the colors defined in the
> > geometry array at the same time ...
> > When the tetrahedron's faces are blue, yellow and red (colors defined in the
> > geometry),
> > the lighting is NOT enabled ...
> > When I set an appearance with material, I loose the colors (red, yellow, blue)
> > defined in the geometry ...
>
> I understand that - but have you actually tried the changes I suggested?
> because when I ran the program you attached it worked fine and I could see
> flat colours with no lighting and shaded colours with lighting.

Yes it works.
But the point is that I'm trying to have what you call "flat colors" WITH the
lighting.
The tutorial says that its possible to use Geometry defined colors (colors per
vertex)
AND have lighting (means create a texture). The tutorial says that the geometry
colors
would take precedence over material colors:

"There are three ways to specify color for a visual object: per-vertex color
specified in the geometry with
getColor() methods (Section 2.5.1), ColoringAttributes of an Appearance node
(Section 2.6.3), and
Material Object (Section 6.3). Java 3D allows you to create visual objects using
none, some, or all three of
the ways to specify color.
When more than one color specification has been made, two simple rules determine
which color
specification takes precedence.
� Material color is only used when rendering lit objects and ColoringAttributes
color is only used
when rendering unlit objects.
� Geometry color ALWAYS takes precedence over ColoringAttributes or Material color.
The rules may be clearer when the problem is divided into lit and unlit objects.
Lighting in enabled for an
object when a Material object is referenced. Conversely, when no Material object is
associated with the
visual object, lighting is disabled for that object. Note that a scene may have both
lit and unlit objects.
When lighting is enabled for an object (i.e., a Material object is referenced),
Material color OR per-vertex
Geometry color is used in shading. If present, per-vertex color overrides the
diffuse Material color. Note
that the ColoringAttributes color is never used for lit objects. Table 6-1
summarizes the relationships."


 Well, thats what the tutorial says and it doesnt seem to work, means that
Geometry-per-vertex-colors
dont seem to override Material color when shading is enabled.

Thanks a lot for your help and time  : )

Frederic Gillet
Xbind, Inc.



=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to