Hi Fred,
| It's not quite clear what rotation you intend to perform.
|
My concern is the following :
I am loading a DTM to model a part of the surface of the earth, texturing it
with an aerial photography.
I am displaying this shape with a perspective viewing (ie rotation of PI/4
along the X-axis).
I would now like to animate this scene in order to give the impression to the
viewer of flying in circle around this surface.
Given that apparently Java3D is not really designed to enable to easily act on
the 'point of view' location and its dynamic updating, but rather seems to have
a 'subject of observation' approch or handling, I feel bound to implement this
by rotating the observed surface instead of the 'point of view'. In that case,
and to be the more realistic as possible, a Z-rotation isn't satisfactory : it
has to be combined with X and Y rotations to keep a perspective viewing and
avoid displaying the 'back' of the surface.
| 1. If your rotations begin and end at the same time, have
| identical speed profiles, and the x- and y-axes you identify are
| fixed, then you can (should?) do it with a single TG and a
| single RotationInterpolator, constructed with the resolved
| Transform3D AxisOfRotation.
In fact althougth the alpha could apparently be shared, the fact is that the
min/Max values are different.
I tried this anyway, thinking that a first step would be to rotate the surface
around the normal of its average plane.
So :
Transform3D axeYZ = new Transform3D();
axeYZ.set(new Quat4f(0.0f, 1.0f, 1.0f, 0.0f));
moteur1 = new RotationInterpolator(alpha1, objSpin1, axeYZ, 0.0f,
(float) Math.PI*2.0f);
And the result is : a rotation along the Y-axis :-(
Or :
Transform3D axeYZ = new Transform3D();
axeYZ.set(new Quat4f(0.0f, 0.0f, 1.0f, 0.0f));
axeYZ.mul(new Transform3D());
moteur1 = new RotationInterpolator(alpha1, objSpin1, axeYZ, 0.0f,
(float) Math.PI*2.0f);
And the result is : a rotation along the Z-axis :-(
It seems that the RotationInterpolator is bound to rotate along the 3 basic
axis and no other ...?
How weird, I must be mistaking myself, don't I?
| 2. If, on the other hand, your y-axis rotates about the z-axis
| (as in a gimbal mount, say) then I think that you've outlined
| the proper way to do it.
|
| BG1
| TGz <- Interpz <- Alpha
| TGy <- Interpy <- Alpha
| Shape3D
I tried it too... with the same result : a rotation along one of the basic
axis. Here are my attempts :
BGroot
TGx <- Interpx <- Alphax
TGy <- Interpy <- Alphay
TGz <- Interpz <- Alphaz
TGrot
Shape3D
gives Z rotation
BGroot
TGx <- Interpx <- Alpha
TGy <- Interpy <- Alpha
TGz <- Interpz <- Alpha
TGrot
Shape3D
gives the same
I even tried to fool the "One object <=> One RotationInterpolator" restriction
doing this :
BGroot
TGx <- Interpx <- Alpha
BGintermediate
TGy <- Interpy <- Alpha
BGintermediate
TGz <- Interpz <- Alpha
TGrot
Shape3D
which resulted in the same Z rotation.
This must be the reason why this solution is awkward and ugly : it doesn't work
:-(
| Part of the awkwardness and ugliness comes from the idea that
| you're forced to confront the details of exactly how the
| rotations happen and their relative frames.
May be, as I'd prefer to handle the 'point of view' animation : a simple Z
rotation...
Or I would find it more elegant to have combining methods associated with the
RotationInterpolator.
Anyway I made the effort to imagine each separate rotation and how they should
combine but I am still not able to make this combination effective. This is
disappointing. But I'll keep on digging and hopefully I'll find a way out of
it.
| In defense of Java, you can figure all of it out once, stuff everything into
a
| subclassed BG or a TG with whatever inner classes you need, and
| forget about it.
It looks like some work has to be done with RotationInterpolator subclassing,
don't you think ?
| The older I get the more I appreciate encapsulation. :-)
(LOL) So do I ;-p
|
| Cheers,
|
| Fred Klingener
| Brock Engineering
Thanks you for your interest, Fred.
I hope I am not being too tedious with this issue, apologizes if it's the case.
Best regards.
Olivier
_____________________________________________________
| From: "Olivier BANASZAK" <[EMAIL PROTECTED]>
| Sent: Tuesday, June 26, 2001 4:08 AM
|
|
| > Hello,
| > Let me submit to you a little problem, that may be will seem
| really too easy
| > for some of you :
| > I wish to perform a shape3d animation that would combine a
| full rotation along
| > the z-axis with a return half rotation along the y-axis.
| > Revising the J3D documentation I read that two interpolators
| cannot target the
| > same object, although nothing prevents it only one would be
| effective in that
| > case. So my question is : is there a way to do it anyway, for
| this appears to
| > me as a necessary and an important feature. The only solution
| I can imagine is
| > using an intermediate TG ie adding the shape to TG1 along with
| alpha1 & RI1,
| > adding it to a BG, then adding this BG to TG2 with alpha2 and
| RI2 then finally
| > adding TG2 to rootBG. This solution looks awkward and ugly, am
| I missing
| > something ?
===========================================================================
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".