.substituteTime(mul(localTime, toBvr(1.3)));
The third doughnut is based on the first one scaled down by 25%,
shifted by 0.2 in negative Z,
and animated at a 40% slower rate than the first one. |
GeometryBvr donut2 = (GeometryBvr)
donut0.transform(compose(translate(0,0,-0.2),
scale3(0.75))).substituteTime(mul(localTime, toBvr(0.6)));
Construct a 3-D rotational transform with a time-varying
axis of rotation and a time-varying angle of rotation. |
Transform3Bvr xf = rotate(vector3(sin(localTime),
cos(localTime), sin(mul(toBvr(1.34), localTime))),
mul(localTime, toBvr(0.62)));
The geometry for the image is the aggregation of the
three doughnuts from above with the animate rotational transform applied. |
GeometryBvr donuts = union(donut0, union(donut1, donut2)).transform(xf);
a camera with projection point at 3 and near plane at 2 |
CameraBvr cam = perspectiveCamera(toBvr(3),toBvr(2));
GeometryBvr geoWithLight = union(donuts, directionalLight);
ImageBvr im = geoWithLight.render(cam);
This translates the image so that its lower left corner
is approximately at the origin. This approximation allows
the image (doughnuts really) to get clipped slightly. |
im = im.transform(translate(0.5,0.5));
return overlay(im, solidColorImage(white));
}
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.