[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Demo for screen locked renderer.



Hi Jim,

I got to thinking about the complexity of my answers
yesterday and decided there might be an easier way.

I've put three files on:

  ftp://ftp.ssec.wisc.edu/pub/visad-2.0/untested/

for you to experiment with. They are (with brief
descriptions of the changes):

  DisplayRendererJ3D.java:
    add 'OrderedGroup screen_locked'
    add addLockedSceneGraphComponent() method
      that adds BranchGroup to screen_locked instead of non_direct
    add 'TransformGroup locked_trans'
      construct and set in first setTransform3D() call with (t != null)
        screen_locked child of locked_trans and
        locked_trans child of root

  DefaultRendererJ3D.java:
    make addSwitch() public

  ScreenLockedRendererJ3D.java:
    override addSwitch() to call addLockedSceneGraphComponent()
    instead of addSceneGraphComponent()

The idea is to create another branch of the scene graph
under screen_locked, which is under a fixed TransformGroup
named locked_trans that contains the initial value of the
TransformGroup (trans) of the main scene graph branch
(under non_direct). Because the TransformGroup is fixed,
the graphics don't move.

One problem with this approach is that the Data objects to
be depicted in a screen-locked manner cannot include any
RealTypes mapped to spatial DisplayRealTypes. They must be
drawn using ScalarMaps to Text, Shape or Flow (screen-locked
Flow icons are probably unlikely), and located via ConstantMaps
to XAxis, YAxis and ZAxis. Using ConstantMaps gets around the
changing linear mappings in spatial ScalarMaps.

If you are interested in this approach, you'll need to rework
your ScreenLockedDemo and the main() method in
ScreenLockedRendererJ3D to conform to this way of doing
things.

For some reason I don't understand, the red square in
ScreenLockedDemo looks larger with this approach. It may be
something about the initial matrix set in trans.

Note in this approach the ShadowScreenLocked*TypeJ3D classes
are unnecessary.

Please let me know if this approach will make it possible to
do what you want.

And please let me know if you have any questions or problems.

Cheers,
Bill