Mathematica 9 is now available

Documentation / DynamicVisualizer / Manipulating Objects / Manipulating Objects /

4.2.6 Moving Objects

Under Mathematica control, an object can be moved relative to its current location or to a specific location. All movements actually describe the transformation between the external frame of reference (the model) and the object's frame of reference. When you set the location of an object, you are actually describing the displacement of its invariant point with respect to the external coordinate system. This is important to bear in mind if the center of an object is not at the origin, and the object appears to move to a peculiar location. In many cases, the invariant point is at the origin. Under these conditions, using the rule Location Rule {3,3,3} would move the origin of an object to this point.

Moving the invariant point (in this case, the origin) moves the object to a new position.

Settings for the Location option.

In[23]:=

Out[23]=

Moving the sphere.

With the camera and the model in their original positions, the positive x axis is to the right, the positive y axis is away from the camera, and the z axis is vertical.

As an alternative to SetOptions, the location of an object can also be set absolutely with the LocateObject function; or optionally, it can be set relative to the current position using the function TranslateObject.

Commands to move an object.

In[24]:=

Out[24]=

Repeatedly calling TranslateObject moves the object further away.

In[25]:=

Out[25]=

Here are two methods of moving an object back to its initial condition.

In[26]:=

Out[26]=

In[27]:=

Out[27]=



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.