Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: controlling shading

Hi Donna,


> I am using java3D to render a flat surface (for color interpolation
> reasons) and would like to turn off shading, since it sometimes relects
> light somewhat strangely. I saw references in the mailing list archive to
> gouraud and flat shading, but I could not figure out how one can set these.
> Thanks in advance---

Texture mapping uses flat shading, so you can get it
with GraphicsModeControl.setTextureEnable(true). This
does not work for IrregularSet domains, and will give
you "blocky" pixels.

You can explicitly control shading by creating a custom
DataRenderer (see tutorial - no day at the beach) that
uses ShadowTypes that override the makeAppearance()
method of ShadowTypeJ3D. Shading is controlled in the
Material used in the Appearence.

Writing a custom DataRenderer will take you out of the
realm of a casual user.

Cheers,
Bill


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690