Re: controlling shading

Well, I decided to make a stab at "turning off" the shading on my flat
surfaces, following the description below, information in the datarenderer
tutorial, and the example of the BarbRenderer. I began by creating the
"skeleton" for my new DataRenderer, which at the moment doesn't do anything
other than the defaults (and it still makes a picture which is a good sign

However I don't quite understand what I need to do to override the
makeAppearance method. I found the makeAppearance method in ShadowTypeJ3D,
which and it looks like I should just be able to do a
"material.setLightingEnable(false)" all the time to turn shading off, but
I'm not clear on where to put this method..... there are a bunch of these
Shadow* classes, and I'm really not clear on which one does what; e.g. I've
ShadowUnshadedRealTupleTypeJ3D, ShadowUnshadedRealTypeJ3D,

You're right, this isn't a day at the beach, but since all I really want to
do is change one small aspect of the rendering, it seems I ought be be able
to just create the skeleton and change "one small thing". But I can't
figure out quite what that is....

Thanks in advance for any help.

Donna L. Gresh, Ph.D.
IBM T.J. Watson Research Center
(914) 945-2472

                      Bill Hibbard                                              
                      <hibbard@facstaff        To:       Donna L 
            >               cc:       
                      Sent by:                 Subject:  Re: controlling 
                      12/19/2002 12:46                                          

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


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: