Re: controlling shading

Hi Donna

In short,  your custom DataRenderer needs to override the
makeShadow* methods defined in DataRenderer->RendererJ3D.
The new makeShadow* methods in the custom renderer return
the the new ShadowType extensions you've created.  Of course,
how, and which, ShadowTypes you extend depends on what
you're trying to do.  I'll let Bill elaborate on this further...

TomR

Donna L Gresh wrote:

> 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
> got
> ShadowUnshadedRealTupleTypeJ3D, ShadowUnshadedRealTypeJ3D,
> ShadowUnshadedFunctionTypeJ3D.....
>
> 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
> http://www.research.ibm.com/people/g/donnagresh
> gresh@xxxxxxxxxx
>
>
>                       Bill Hibbard
>                       <hibbard@facstaff        To:       Donna L 
> Gresh/Watson/IBM@IBMUS
>                       .wisc.edu>               cc:       
> visad-list@xxxxxxxxxxxxx
>                       Sent by:                 Subject:  Re: controlling 
> shading
>                       billh@xxxxxxxxxxx
>                       du
>
>
>                       12/19/2002 12:46
>                       PM
>
>
> 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