8
$\begingroup$

I'd like to animate an object moving over a surface and have the object positioned so it follows the slope (normal) of the surface.

Using a shrinkwrap constraint, the object will follow the change in height of the surface.

enter image description here

However, it is not clear how to make the cone follow both the height and slope (normal). In the image below, the red cone shows the desired orientation of the white cone at one point in time.

enter image description here

How can the cone in the animation be animated to follow both the height and slope (normal) of the surface?


Sample blend file here


Using the solution from Lukas, and making sure scaling was applied to the objects, this is the result!

enter image description here

$\endgroup$
8
$\begingroup$

I got it to work using a second mesh and the shrink wrap modifier (not the constraint).

First thing you need to do is add a single triangle mesh object.

enter image description here

Then place your cone object so it is sitting on top of the triangle.

enter image description here

Select the cone object, then shift select the triangle. Now tab into edit mode.

In edit mode select all three vertices and press ctrl+P, then choose make vertex parent.

enter image description here

Back in object mode add a Shrink Wrap modifier to the triangle object. Set the target as the ground plane and set the mode to project. Make sure to select the right axis.

enter image description here

The cone should automatically adopt the z-y coordinates of the triangle, and the z height and normal of the ground above or below the triangle. If the triangle doesn't follow the ground properly try checking both the Positive and Negative options in the shrink wrap modifier.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.