Limit Camera rotation while following path

I converted the paintingmy daughter did into a height mapped terrain. Then I selected one row of verts (with Alt+Shift+RMB), duplicated them, seperated them, raised them above the terrain and converted them to a curve. The camera was moved and rotated to the head of the curve and parented to it using ‘Follow Path’. CurveFollow is turned on so the camera rotates with the ups and downs of the path, but the rotations are too extreme. I can lock the Y and Z rotations.

Is there a way to limit the rotation of the camera on X to a certain range like you can with bones?

<edit>
If you have a strong stomach, you can check out the rendered version below. I made a more interesting curvy path and slowed it down.
http://www.youtube.com/watch?v=UaZHBURpKAE

I found one kind of kludgey solution: copy the cam path curve, move the copy up and a little forward, parent an empty to the copy and have the camera track to the empty. It would be nice if you can just limit the rotation instead.

Attachments


If you can host the .blend somewhere I can edit it to show you how to do this.

Thats so cool! I love that flying effect but understand the preference for more gentle aiming of the camera. I would have suggested track to empty too, why not flatten (or leave very gentle undulations in) the curve (that the empty follows) and lower it down to mid line for your camera path? This way the camera should point mostly ahead when required.

I must go and plagarise some of my kids stuff imediately, it looks like a great approach to artists block :wink:

In the next release of blender (or any cvs version from about a month ago onwards), blender has a set of Transform Limiting Constraints. One of these is a rotation limiting constraint, which should be able to handle what you describe.

Aligorith

JonathanK: here’s the blend file . Thanks.

David: That’s a very good idea. I think I can scale a curve on just the z axis. Thanks!
<edit> I did a quick test and flattening the empty path does work. For this animation I think it looks better if the empty is a little below the midline so you see more of the terrain. I forgot I can fine tune the TrackTo influence, too.

Aligorith: Cool! but I haven’t learned half the new stuff 2.42 does yet.

DadCantDraw it really is a promising fly through, please repost it on the tube when you get it just right. I saw a Vue landscape fly through while I was there, and it “sucked” (jerky movement and dodgy path), but the landscape was nice.

Okay, I’ve got something that works. The basic idea is to clip the X rotation to be only within a certain range. Since a camera points in the -Z direction, with +Y being ‘up’ for the view, a positive X rotation brings the view to point in the XY plane.

The problem I found was that the constraints were overriding the clipping I implemented. So, to solve that, I made a different object track with the constraints, then copied the parameters from that object to the camera, after clipping.

Here’s the file.

If you play through the animation without any interaction or rendering, the camera will lag behind one frame from the target. This shouldn’t be an issue with rendering, or interactive playback of the timeline.

Very cool! Thank you! I didn’t even know that script link thing was possible. Very clever, too; a camera’s rotation can’t be limited, but they can copy an object that’s clipped.

It takes about 8-10 seconds per frame to render. At 750 frames, it should only take a couple hours. I’ll render then repost to youtube.

<edit>
I added the new render to youtube: http://www.youtube.com/watch?v=UbKDNI7_mMU

I may make one more; there is a spot in the middle where the camera seems to fly sideways, the path needs to be smoothed a bit more and I may reduce the height map a little.
Thanks again! The script link opens a whole new aspect of Blender.

You know, I think the first one is more engaging, like a flight in a hang glider. Maybe its the realistic whistling of the wind (through your lips?) :wink:

But I do prefer the first I think the second has to much eratic panning and not enough tilting now. But its still entertaining.

David: Thanks for the input. I wasn’t quite satisfied with the second one and plan to make another so I didn’t add the sound. I’m working on a couple other projects and, gasp, non-Blender things so I’m not sure when I’ll render the third one.

you could light up the scene a little better to!