NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: standard matrix with aspect ratios

Hi Don,

Here's the best I can think of right now (I'm travelling):

1. Undo the aspect ratios by calling setAspect() again
with the numerical inverses of the aspect ratios (i.e.,
1.0/aspect(0), 1.0/aspect(11), 1.0/aspect(2)).
2. Call getMatrix() to get the matrix = m1.
3. Call setAspect() again to reset the aspect ratios.
4. Call
  MouseBehaviorJ3D.unmake_matrix(rot, scale, translate, m1)
to get the rotation angles, scale, and translations of the
matrix.
5. Call MouseBehaviorJ3D.make_matrix() to make a matrix m2
with the same scale and translations of m1, but with the
rotations for an overhead view.
6. Use MouseBehaviorJ3D.multiply_matrix() to mimic the
code in ProjectionControlJ3D.setAspect() to apply your
aspect ratios to m2.
Something like that.

Good luck,
Bill

On Wed, 4 May 2005, Don Murray wrote:

> Hi-
>
> I have a 3D display with a particular aspect setting.  I
> want to create a matrix that would correspond to the
> overhead view (z pos on top), with the aspect ratio applied.
> I can't just call getMatrix() because the box might be
> rotated.
>
> I looked at the code down in ProjectionControlJ3D which does
> this when you use setAspect, but I'd like to avoid the
> java3D specific references.
>
> I'm wondering if I can get the same effect with some combination
> of multiply_matrix.  I'm thinking that the default box would be:
>
> make_matrix(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
>
> but I'm not sure how to apply the aspect ratio to this.
>
> Any help would be appreciated.
>
> Thanks,
>
> Don
> *************************************************************
> Don Murray                               UCAR Unidata Program
> dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
> (303) 497-8628                              Boulder, CO 80307
> http://www.unidata.ucar.edu/staff/donm
>          "Time makes everyone interesting, even YOU!"
> *************************************************************
>
>
>


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