On Wed, 21 Apr 1999, Christian Petermann wrote:
> I tried to do the following:
> ...
> Point3d position=new Point3d(0.0, 0.0, 0.0);
> Transform3D transformPos= new Transform3D();
> shape.getLocalToVworld(transformPos);
> transformPos.transform(position);
>
> I know that the shape move from 0,0,0 to -2,0,-2 (I'm using a
> PositionPathInterpolator).
> When I dump the position on screen, it starts a -0.8,0.0,-0.8
> and finishes at the same point... This is obviously not correct as the
> shape moved in the scene from 0,0,0 to -2,0,-2.
Pass, it always works for me. However, I think you need to be careful with
just what you are transforming. Where is your shape defined to be before
it is transformed? Inside the unit cube? Inside a cube of length 2 centred
at the radius etc. You also need to be consistent as to what you mean by
the position of your shape - if you mean the position of it's centre then
instead of transforming (0.0,0.0,0.0) you should transform a point that
corresponds to the shape's centre before it was transformed.
For example, if your shape is a cube defined from 0.0 to 1.0 in each
direction then you want to be transforming the point (0.5,0.5,0.5).
HTH
Tim.
,----------------------------------------------------------------------.
| Tim Needham. |
| OU Computer Society Ex-President. |\ ___,,--,_ __ |
| [EMAIL PROTECTED] /,`--'' \`,,__,',-'|
| http://ox.compsoc.net/~timothy |,4 ) )_ ) /~-----' |
`------------------------------------------'---^~(_/-_)--(_/_)---------'
Q: Why did the chicken cross the Moebius strip?
A: To get to the other ... er, um ...
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/