Re: 20001030: 3D ProjectionControl matrix & point of view

Hi Don,

> >However, there may be differences between the Java3D matrices used
> >in VisAD and the OpenGL matrices used in Vis5D (e.g., transpose).
> >If the make_matrix parameters from vis5d_set_ortho_view() don't
> >work quite right, it may only be a matter of permuting them a bit.
> >This should not be all that hard to do with a little experimentation.
> >Let me know if you need a little help.
> 
> It seems that using the Java matrices, the Y takes precedence over
> the X.  So EAST and WEST did not work right and should be:
> 
> display.make_matrix(0.0, 90.0, 90.0, 1.0, 0.0, 0.0, 0.0);
> 
> and
> 
> display.make_matrix(0.0, -90.0, -90.0, 1.0, 0.0, 0.0, 0.0);
> 
> respectively.  However, by creating a matrix and then setting the matrix
> in this way you lose any aspect and scaling that was there before and
> the box takes up the whole display.  Is there an easy way to keep
> those around?

Thanks for figuring these out.

Well, you can use MouseBehaviorJ3D.unmake_matrix() to get
the rotation angles, scale and translations of the previous
matrix, then for example put the scale back into the new
make_matrix() call.  Of course, this doesn't help with uneven
scales if you've called setAspect().

> >Once this is working it would be very useful to add a set_ortho_view()
> >method to ProjectionControlJ3D or MouseBehaviorJ3D.
> 
> I agree.  There are some issues when you are dealing with non-linear
> map projections (like what does NORTH mean when you are looking at
> a polar stereographic view of the northern hemisphere centered on
> the pole), but we could use these cardinal directions like BorderLayout
> does to refer to sections of the original display space.

These names reflect Vis5D's world view.  You could use names
like xplus, xminus, yplus, yminus, zplus and zminus for views
from the ends of the three Cartesian axes.

> Of course, I'd prefer setOrthoView() ;-). Once I get the aspect and
> scaling right, I'll add this method in.

Great.

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