Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

OOps, Re: Fixed text size query...

I wrote:

> 2. Since you know that:
> 
>   Transform3D theTransform = new Transform3D();
>   theTransform.set( 1 / aScale[ 0 ], theTranslationVector );
>   theTransformGroup_.setTransform( theTransform );
> 
> works for fixing the location and size, you might try:
> 
>   Transform3D theTransform = new Transform3D();
>   theTransform.set( 1 / aScale[ 0 ], theTranslationVector );
>   Transform3D scale = new Transform3D();
>   scale.set( 1 / aScale[ 0 ] );
>   theTransform.mul(scale);
>   theTransformGroup_.setTransform( theTransform );

Clearly this should not re-apply the scale, but apply the
inverse of the translation in 'scale'. That is:

  Transform3D theTransform = new Transform3D();
  theTransform.set( 1 / aScale[ 0 ], theTranslationVector );
  Transform3D translate = new Transform3D();
  Vector3d inverse = new Vector3d();
  inverse.x = -theTranslationVector.x;
  inverse.y = -theTranslationVector.y;
  inverse.z = -theTranslationVector.z;
  translate.set( inverse );
  theTransform.mul(translate);
  theTransformGroup_.setTransform( theTransform );

> I may have some detail wrong, like the order of multiplying
> matrices, but with a few experiments you may get it. When I
> write such transform matrix code, I always have to experiment
> to get it right.

And of course, you can probably accomplish the same thing
with your original code and experimenting with arithmetic
operations on the x, y and z values in theTranslationVector.

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


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