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.
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
visad
archives: