I don't have any simple examples but the process is quite
straightforward... ;-)

Place all objects that you want to appear in display overlay (i.e. a
HUD or dashboard) under the parent transform of the view you want them
to appear in.  This essentially places the objects in "view space"
(i.e. they move with the view).  Then, to keep the display overlay
objects away from the rest of the world you move them really close to
the eyepoint and scale them down according to the internal geometry of
the view/display/screen.  This places them in a pseudo "display space"
measured in pixels.

To make things convenient I do this with a common display overlay
group that I created.  It places its children at a nominal distance of
1.0 from the eyepoint and then computes a scaling factor such that its
child nodes (i.e. the display overlay objects) exist in a 2D space
whose coordinates are in pixels.  You just have to be sure that the
display objects are flat and that you only move them in X-Y and not
Z.  If you want to get fancy you can shift them slightly in Z (and
recompute their display normalization scaling factor accordingly) to
impose a Z-order on how the display overlay objects overlap.

The formula for the scaling factor used in the display overlay group
is as follows:

scale = 2.0 * DISP_DIST * _fovTan * (_size/_viewScl)

Where, DISP_DIST is the distance from eye to display space plane
(which I set at 1.0).  _fovTan is Math.tan(fov/2.0).  _size is the
apparent size of a unit size object on the screen, in this case the
size of a single pixel, computed as 1.0/screen_resolution_in_pixels.
And finally, _viewScl is the view scale factor.  If you use the
defaults for View then it is computed as display_size_X/screen_size_X,
where display size is the size of the display window (i.e. the canvas
dimensions).

Of course there are some practical considerations to all of this since
it is only pseudo-overlay (see my earlier posting on suggestions to
enhance pseudo-overlay support in Java 3D).

good luck
--jon

> Date:    Tue, 21 Sep 1999 16:03:40 -0700
> From:    Tim Bray <[EMAIL PROTECTED]>
> Subject: Any dashboard examples?
>
> Anyone have an example of a dashboard-style thing?  I'm trying to add
> status readouts to PlatformGeometry objects in the presence of a
> KeyboardNavigator and having trouble producing any visible effect. -Tim

--
____________________ Peculiar Technologies ____________________
Jon Barrilleaux       3800 Lake Shore Ave.         Purveyors of
[EMAIL PROTECTED]        Oakland, CA 94610      Alternate Reality
510.444.4370 voc                           Augmented Simulation
510.444.0231 fax        www.augsim.com         and 3D Solutions

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to