lmcolor and lighting a surface with a scalar field

Tim Hall tjh at bucrf11.bu.edu
Thu Jul 26 01:43:47 AEST 1990


In article <2042 at sparko.gwu.edu>, favre at seas.gwu.edu (Jean M. Favre) writes:
|> 
|> The problem is that BOTH sides of the surface are shaded because the
material 
|> properties are modified.

I think this is because of the position of the light and the normal.  Even
if the polygon normal is facing away from the eye point the polygon will
get diffusely shaded.  

|> 
|> What I want is the side facing away from the normals to be shaded with a
|> uniform gray color so that I can easily distinguish the inside and outside
|> of the surface.

One solution is to use backfacing and render your surface twice.  Turn on
backfacing and draw all your polygons with their colors.  This will only
draw the polygons facing you.  Redraw the surface with the surface normals
inverted and a grey material bound.  Now the polygons facing away from you
will be grey.  Be sure to specify your polygons in counter clockwise order.

If you have 3.3 use two sided shading.  This is a new feature and allows
you to specify two materials for the front and back of the surface.  See
the "Graphics Library Programming Guide" page 9-17.  (This is the updated
manual with 3.3)

|> 
|> Can anyone give me some help?
|> 
|> Thanks in advance.
|> --
|> Jean M. Favre. EE&CS Dept. The George Washington University
|> 		(202) 994 7532
|> 		favre at gwusun.gwu.edu



More information about the Comp.sys.sgi mailing list