This section includes two examples of implementing aim constraints.
Aiming a sphere at a sphere
To setup the two spheres
- Create a NURBS sphere.
- Move the sphere some distance away from the center of the scene.
- Create another NURBS sphere. Leave it at the scene’s origin.
- Display the sphere’s local rotation axis (Display > Transform Display > ).
To create an aim constraint
- Select the you moved sphere, and then select the sphere at the origin.
- If you are sure that the constraint options have their default settings, select Constrain > Aim. (To be sure that you are using the defaults, select Constrain > Aim. Click , and then click .)
To use the aim constraint
- Select the sphere you moved (nurbsSphere1), and select the . As you move the sphere, the other sphere (nurbsSphere2) will rotate accordingly.
Note how nurbsSphere2’s local rotation X-axis always points at the nurbsSphere1. Also, note how nurbsSphere2’s local rotation
Y-axis always tries to point as closely as possible in the same direction as the scene’s Y-axis.
By default, the aim vector causes nurbsSphere2’s local rotation X-axis to point at nurbsSphere1. Also, by default, the up
vector causes nurbsSphere2’s Y-axis to align itself as closely as possible with the scene’s Y-axis.
Aim a cone at a sphere
To create sphere and cone
- Create a NURBS sphere.
- Move the sphere some distance away from the scene’s origin.
- Create a NURBS cone.
To create an aim constraint
- Select the sphere, and then select the cone.
- Select Constrain > Aim > .
- Set to 0.0, 1.0, 0.0. (The default is 1.0, 0.0, 0.0.)
- Set to 0.0, 0.0, 1.0.
- Set to 0.0, 0.0, 1.0.
- Click .
- Now you have constrained the cone to aim at the sphere.
To use the constraint
- Select the sphere, and select the . As you move the sphere, the cone will always point at the sphere.