Legacy Documentation

Dynamic Visualizer (2008)

This is documentation for an obsolete product.
Current products and services

Documentation / DynamicVisualizer / Manipulating Objects / Manipulating Objects /

4.2.7 Orientation

The location, scale, and orientation of an object are stored as a single 4×4 transformation matrix. However, full control over this matrix is often unnecessary and cumbersome. Instead, Dynamic Visualizer lets you specify the orientation in several, more convenient, ways.

Different ways to set the orientation of an object.

These all are discussed in detail in "Appendix 2: Orientation Commands". Here we provide a few examples of each.

The invariant point defines the point that remains in the same position when an object is rotated or scaled. When an object is created, this point is either at the object's origin or at its center, depending on the preferences set in Dynamic Visualizer. You may wish to override the default and set InvariantPoint explicitly.

For example, we can rotate the torus by 90° about {0, -1, 0}.

In[28]:=

The orientation of an object is reset if the invariant point is changed.

In[29]:=

Out[29]=

Settings for the InvariantPoint option.

The rotation specified in YawPitchRoll format is defined by three successive rotations about the z, x, and y axes.

In[30]:=

The EulerAngles option is useful when an object spins about an axis of symmetry along the z axis. In essence, the first two angles define the direction of the object's z axis, and the third angle defines the rotation about this axis.

In[31]:=

Using the TransformationMatrix option, it is possible to specify either an explicit 3x3 rotation matrix or, alternatively, a full 4×4 transformation matrix that includes scaling and location information. Any scaling information supplied in a 3×3 matrix is ignored. Reflection and shear matrices are not supported. Dynamic Visualizer attempts to orthonormalize the rotation matrix, but this may not always be possible and may lead to peculiar rendering effects.

This uses the 3×3 version of the TransformationMatrix to rotate the sphere about the z axis.

In[32]:=

This uses the 4×4 version of the TransformationMatrix option to scale the sphere.

In[33]:=

The AxisAndAngle option is useful when the rotation is known to be about a particular external axis. The axis does not need to be normalized but does need to be of nonzero magnitude. For example, you can rotate the sphere about the {1, 0, 0} direction.

In[34]:=