Transform - Adobe ATMOSPHERE User Manual

Table of Contents

Advertisement

Methods
blend(b, fraction)
Returns a rotation that is the interpolation between a and b according to the specifi ed fraction (0..1)
// 10% of the way from a to b
c = a.blend(b, .1);
map(vec)
Returns a Vector that results from rotating 'vec' by this Rotation
forward = orientation.map(Vector(0.0, 0.0, -1.0));
mapAxis(axis)
Returns the specifi ed axis(0, 1, 2 == x, y, z) rotated by this Rotation
forward = orientation.mapAxis(2).negate();
power(pow)
Raises the Rotation to the specifi ed power
// b rotates 2.5 times as far as a.
b = a.power(2.5);
toString()
Returns the Rotation encoded as a string. This provides a way in which rotation information can be sent over
the chat line to another visitor in the same world. The receiving visitor can then decode the rotation using this
approach:
box.rotation = Rotation(newRotation.toString())
newRotation = currentRotation.toString()

Transform

A Transform is a geometric transformation composed of an arbitrary rotation followed by a translation. Most objects
use a Transform to specify their location and orientation. Various methods are provided to make manipulation
of Transforms straightforward, without regard to the underlying representation. (A Transform is equivalent to a
constrained 3x4 linear transformation matrix with an orthonormal 3x3 rotational sub-matrix. It is actually stored
internally as a quaternion and a translation. Due to this, it's useful to note that using chat.print(transform) for
debugging purposes will return an array of 6 values. This format, however, cannot be used for setting a Transform,
but is useful only for observing the results of an operation.)
Global Methods
Transform(various...)
Creates a new Transform(spatial transformation object). The following parameter styles are understood:
• Transform() - The identity transformation (no rotation or translation)
• Transform(translateVec) - Translate by the given Vector
259
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents