Re: controlling shading

Well, following your example, and putting my version of makeAppearance into
ShadowUnshadedFunctionTypeJ3D worked just as it should, thanks. My problem
mainly was figuring out where to put it; The bom barbrenderer example put
it into the ShadowBarbRealTupleType class (if I recall), while the bom
ImageRenderer puts it into ShadowFunctionType.  How does one know the
*right* place to put it?


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

                      Bill Hibbard                                              
                      <hibbard@xxxxxxxxxx        To:       Donna L 
            >                   cc:       
                      Sent by:                   Subject:  Re: controlling 
                      01/27/2003 11:39 AM                                       

Hi Donna,

> Hmmm, I'm still missing something. What I've got now is a class
> UnshadedRenderJ3D, which has a bunch of things along the lines of
> public class UnshadedRendererJ3D extends DefaultRendererJ3D {
>   public UnshadedRendererJ3D () {
>     super();
>   }
>   public ShadowType makeShadowType(
>          FunctionType type, DataDisplayLink link, ShadowType parent)
>          throws VisADException, RemoteException {
>     return new ShadowUnshadedTypeJ3D(type, link, parent);
>   }
>   public ShadowType makeShadowFunctionType(
>          FunctionType type, DataDisplayLink link, ShadowType parent)
>          throws VisADException, RemoteException {
>     return new ShadowUnshadedFunctionTypeJ3D(type, link, parent);
>   }
> .......
> Then I have a new version of (non-static) makeAppearance, which I have
> placed in ShadowUnshadedTypeJ3D. This version of makeAppearance does
> something different with the lighting. But I'm never entering that
> What else do I need to do? I previously had a bunch of makeAppearances
> in the other ShadowUnshaded.... guys, just referring back to the one in
> ShadowUnshadedTypeJ3D, but the compiler complains about referencing a
> non-static method from a static context... I'm not enough of a java
> to sort this all out...

Just to test this, I tried it myself, adding the method:

  public Appearance makeAppearance(GraphicsModeControl mode,
                      TransparencyAttributes constant_alpha,
                      ColoringAttributes constant_color,
                      GeometryArray geometry, boolean no_material) {
    return super.makeAppearance(mode, constant_alpha,
                           constant_color, geometry, no_material);

to visad/bom/ Then I ran:

  doll% java test.gif

and as you see it did print the message that it was invoked.

I suggest you compare your DataRenderer and ShadowTypes to:




and compare your code to these, with respect to what
class extends what, etc.

Good luck,