Re: Lighting

Hi Steve,

> 1) Do I change the lighting on a Display3DImpl
> in the obvious way of adjusting the light branch in the
> scene graph directly or is there support inside of
> VisAD to do this differently?

Lighting in a DisplayImplJ3D are taken care of by the
DisplayRendererJ3D.  There are four different extensions
to this abstract class (DefaultDisplayRendererJ3D,
TwoDDisplayRendererJ3D, ImmersaDeskDisplayRendererJ3D
and TransformOnlyDisplayRendererJ3D) which implement
the createSceneGraph() method that constructs lights.
The intention is that applications can define their
own extensions of DisplayRendererJ3D to control lights
(with cut-and-paste editting of DefaultDisplayRendererJ3D
this shouldn't be too difficult).

However, if you prefer to use the existing DisplayRendererJ3D
subclasses and manipulate the lights on the scene graph,
you can get the root BranchGroup of the scene graph by
DisplayRendererJ3D.getRoot().  Then find the lights as
children of root and modify them.  Note this requires a
change to DisplayRendererJ3D.java to make the children of
root accessible.  This change will be in the next VisAD
source update, or you can add some lines:

    root = new BranchGroup();
    root.setCapability(Group.ALLOW_CHILDREN_READ); // add this line
    root.setCapability(Group.ALLOW_CHILDREN_WRITE); // add this line
    root.setCapability(Group.ALLOW_CHILDREN_EXTEND); // add this line

> 2) Similarly, is there a way to adjust the initial
> orientation of a 3D Plot or should I essentially
> adjust the camera position?   Do the interactors
> provided control the object or the view branch
> transform?

Call ProjectionControl.setMatrix().  See visad/examples/Test57.java
for an example.  This controls a TransformGroup under
root on the object side.  I prefer that to the ViewPlatform
side since that way we are compatible with options on the
ViewPlatform for multi-wall CAVES etc.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


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