The 3-D animation
the length of the first segment of the animation in seconds |
NumberBvr period = toBvr(6);
time-varying angle, does a complete cycle per period |
NumberBvr aniAngle = mul(localTime, mul(toBvr(2),
div(toBvr(Math.PI), period)));
A translation between front and back Z limits used for
travel of the center of the geometric image.
The limits are related to the extent of the picture. |
NumberBvr distOfTravel = mul(toBvr(20), maxHalfExtent);
Transform3Bvr trans = translate(toBvr(0), toBvr(0),
mul(neg(distOfTravel), sin(aniAngle)));
a rotation with rate "aniAngle" around a time varying axis |
Transform3Bvr rot = rotate(vector3(sin(aniAngle), cos(aniAngle),
div(sin(aniAngle), toBvr(2))), aniAngle);
tumbling in 3-D animation, performs a complete cycle in one "period": |
Transform3Bvr rot1 = compose(trans, rot);
open page animation, opens in one quarter of "period": |
Transform3Bvr rot2 =
compose(translate(neg(xUpperRight), toBvr(0), toBvr(0)),
compose(rotate(yVector3, neg(aniAngle)),
translate(xUpperRight, toBvr(0), toBvr(0))));
close page animation, closes in one quarter of "period": |
Transform3Bvr rot3 =
compose(translate(neg(xUpperRight), toBvr(0), toBvr(0)),
the -PI/2 is to pick up from where the page open animation left of |
compose(rotate(yVector3, add(div(neg(toBvr(Math.PI)), toBvr(2)), aniAngle)),
translate(xUpperRight, toBvr(0), toBvr(0))));
the cyclic animation of the geoimage:
- tumbling in 3-D in one "period"
- open page in quarter of "period"
- close page in quarter of "period" |
NumberBvr quarterPeriod = div(period, toBvr(4));
Transform3Bvr loopingTrans = Transform3Bvr.newUninitBvr();
loopingTrans.init(until(rot1, timer(period),
until(rot2, timer(quarterPeriod),
until(rot3, timer(quarterPeriod), loopingTrans))));
GeometryBvr loopingGeoImage = geoImage.transform(loopingTrans);
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.