> From: "Andrew R. Thomas-Cramer" <[EMAIL PROTECTED]>
> > From: Doug Gehringer <[EMAIL PROTECTED]>
> >
> >> In a possibly related question, what do the scale components of the
> >> ViewingPlatform transform mean?
> >
> >Two other ways of changing the scaling of a scene are to use a scaling
> transform
> >above the object, making the object bigger or smaller in VWorld coords; or
> to
> >use a scaling transform above the ViewPlatform, making the virtual observer
> >bigger or smaller in VWorld coords.  Note that changes to to the local to
> VWorld
> >transform for the ViewPlatform have the opposite effect as changing the
> tranform
> >on the object: scaling by 1/10 on the ViewPlatform makes the object appear
> 10x
> >bigger.
>
> Before my question, when I modified the scale of the transform in
> ViewingPlatform, it didn't change the apparent size, but it did _allow_ the
> apparent size to be increased via navigation. It was as if the apparent size
> had been increased, but the apparent distance of the viewer from the scene
> had also been increased, so that exactly the same portion of the view was
> shown before and after.
>
> I changed the scale in a subclass of ViewingPlatform via:
>
>     Transform3D transform = new Transform3D();
>     this.getViewPlatformTransform().getTransform( transform );
>     transform.setScale( transform.getScale() * (1 / factor) );
>
> Have I changed the scale incorrectly?

No, you applied the scale correctly, but it affect the translation as well. So
your objects got larger by 'factor' but you also moved further away by 'factor',
so the net result was the apparent size remained the same.

If you want to scale the scene without affecting the translation, try separating
the scale and translation into separate Transform3D's, and then use
Transform3D.mul() to combine them.  Depending on the order of the
transformations (result.mul(scale, translate) vs result.mul(translate, scale)),
the translation will happen either before the scale or after the scale.
Translation before scaling leads to the scale affecting the translation,
tranlation after scale leads to the scale not affecting the translation.   I'm
"hand waving" on this a bit, since it is hard to sort out the order of
operations, especially when you are changing the view platform transform.  It's
easier to just try it one way and then reverse the order if that doesn't work.

Doug Gehringer
Sun Microsystems

===========================================================================
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