Re: Adding 2nd view for holoscreen floor projection

Hi Bill, hi list,

thanks for your answer Bill. I spend some time to take a deeper look into the
VisAD source code before writing this reply.
The major problem in adding one or more views to VisAD to get a
holoscreen/cave-ready projection is the fact, that the VisAD design is layouted
to have one View and one VisADCanvasJ3D (assuming the api is JPANEL).

It is no problem do a "dirty" step and add second view+canvas by getting the
scenegraph root from the display renderer.
Here just a snippet of code to make it clearer:

----- snip ----
...
display = new DisplayImplJ3D(getTitle());

// repace original view transform of first (vertical) view
TransformGroup tg
    ((DisplayRendererJ3D) display.getDisplayRenderer())
        .getViewTrans();
tg.setTransform(getHorzViewingTrans());

VisADCanvasJ3D c
    new VisADCanvasJ3D(
        (DisplayRendererJ3D) display.getDisplayRenderer());

BranchGroup b = createView(c, getVertViewingTrans());
    ((DisplayRendererJ3D) display.getDisplayRenderer())
        .getRoot().addChild(b);
...
getContentPane().setLayout(new GridLayout(2,1));
getContentPane().add(display.getComponent());
getContentPane().add(c);
...

protected BranchGroup createView(VisADCanvasJ3D c, Transform3D viewingTrans) {
    ViewPlatform vp = new ViewPlatform();
    View v = new View();
    v.addCanvas3D(c);
    v.setPhysicalBody(new PhysicalBody());
    v.setPhysicalEnvironment(new PhysicalEnvironment());
    v.attachViewPlatform(vp);

    TransformGroup viewTG = new TransformGroup();
    viewTG.setTransform(viewingTrans);
    viewTG.addChild(vp);

    BranchGroup viewBG = new BranchGroup();
    viewBG.addChild(viewTG);
    return viewBG;
}

--- snip ---

So far so good. We got our second view with a working MouseBehavior. But this
attemp has some sideeffects (and some more I haven't discovered - I'm pretty
sure) i.e. the cursor string is incorrectly drawn on the second canvas. VisAD
isn't aware of the second canvas. I've tried to extend some classes (i.e.
DisplayRendererJ3D, DisplayImpl, DisplayPanelJ3D...) to add a multi canvas
support, but while doing this, I realized that this a lot of work because all
the VisAD is working with only _one_ VisAdCanvasJ3D. Beside this it turns out
that VisAdCanvasJ3D is only working with DisplayImplJ3D and not with my
extention of DisplayImpl because of the type cast to DisplayImplJ3D in the
contructor of VisAdCanvasJ3D - if I'am right.

I really don't know what I should do. Adding a full functional multi
view/projection support to VisAD is too much work for me in my project. So, I
guess I will use the way I described and try to bypass the sideeffects with
some workarounds. But I'am still very intrested in a more "VisAD conform"
solution of this problem. If anyone got a good idea to integrate another
view/projection into VisAD I would be very happy and thankfull.

regards,
Finn




----- Original Message -----
From: "Bill Hibbard" <billh@xxxxxxxxxxxxx>
To: "Finn Klug" <finn.klug@xxxxxxxxx>
Sent: Thursday, May 01, 2003 5:16 PM
Subject: Re: Adding 2nd view for holoscreen floor projection


> Hi Finn,
>
> I'm at a meeting and can't devote much time to this, but
> what you need for this is to develop a new extension of
> DisplayRendererJ3D. Use that class and DefaultDisplayRendererJ3D
> as guides. You would pass an instance of your extenson to
> the DisplayImplJ3D constructor. It is in the DisplayRenderer
> that the scene graph is created and linked to Java3D. You'd
> need to figure out how to have two Views in your scene
> graph.
>
> Good luck,
> 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
>
> On Thu, 1 May 2003, Finn Klug wrote:
>
> > Hello,
> >
> > I'am trying to figure out how the best way is to add a second
> > view/perspective of a visad scene to the Java3D scenegraph (or JFrame).
> > This second view needs to have a different viewing transformation, but that
> > didn't seem to be the problem. It's just a different view of the scene,
> > transformed to be the floor projection of a 2-sided (wall+floor) holobench.
> > I'am still having problems to find the common way to add this second
> > perspective. Later the two views need to be linked in a way to do the same
> > interaction with the scene (orbit/translate) on both screens. But atm I'am
> > happy for every hint to add this second view in a proper way.
> >
> > Thanks in advance,
> > Finn
> >
> >
> >
> >
> >
>
>