2
$\begingroup$

Background: I have a large terrain mesh (~6M vertices) which I would like to "drive" over with my camera. The mesh was sourced from a high quality physical terrain DEM. I am using the Shrinkwrap Object Constraint to keep my camera a constant distance from the ground. This works well. It has an option: "Align to Normal" which allows me to align my camera to the surface normal of the terrain face closest to the camera.

The problem: Using the "Align to Normal" option on the camera constraint can be fairly jarring as you sometimes will hit small regions of terrain that have notable slopes/dips (e.g. tiny craters). Is there a way to smooth it out without relying on physics bodies? I don't want to simulate a "gimbaled" camera, but instead a camera on a vehicle which has a rocker-bogie suspension. The reason why I would like to avoid creating physics bodies is that it runs really slowly with this many vertices. An example of this terrain is shown below. terrain

My idea for a solution: If I could average the normals for a small area underneath my "camera/vehicle" which the camera would then align to, then the camera movement would be much smoother when going from point A to B (for an animation) and would be a good enough approximation for my goal.

What I tried: I attempted using a shrinkwrap modifier on a small subdivided plane that was on the terrain surface and then aligning my camera to that, but it was even noisier in terms of camera rotation.

EDIT: By "noisier" I mean the camera angle change from frame to frame (with a fairly small distance delta) when moving in a line is more abrupt.

$\endgroup$
5
  • $\begingroup$ I would have tried what you suggest at the end, what do you mean by noisier in termes of camera rotation? how can it be noisier than the original ground, plus can't you limit the rotation? $\endgroup$
    – moonboots
    Commented Sep 14, 2021 at 6:59
  • $\begingroup$ I was wondering if there is a simple solution that can be done without scripting, but perhaps that's not the case. By noisier I mean that there are larger changes in angle from frame to frame when going over rough spots. Now that I think about it, it's probably because the plane is less dense than the ground and is going to result in even more abrupt changes. Perhaps scripting a constraint would be the better approach here... $\endgroup$ Commented Sep 14, 2021 at 16:01
  • 1
    $\begingroup$ Related blender.stackexchange.com/a/175503/15543 $\endgroup$
    – batFINGER
    Commented Sep 14, 2021 at 16:12
  • 1
    $\begingroup$ If I wanted to do this, I would edit the mesh. Make a non-rendering duplicate and give it a smooth modifier, then set the shrinkwrap to target that duplicate instead. Tune the smooth modifier to smooth out the constraining mesh as desired. $\endgroup$
    – Nathan
    Commented Sep 22, 2021 at 15:29
  • $\begingroup$ @Nathan that's a good idea that isn't too complicated. I'll try it when I get the chance. $\endgroup$ Commented Sep 22, 2021 at 18:07

0

You must log in to answer this question.

Browse other questions tagged .