Friday, September 10, 2010

Creating a Roller Coaster in Blender 2.5 - Part 3 (Animating the Camera)

Hello, everyone!  This is the 3rd and final part of my roller coaster tutorial series; you can find the previous parts here:

Part 1: http://ssimpossible.blogspot.com/2010/09/creating-roller-coaster-in-blender-25.html
Part 2: http://ssimpossible.blogspot.com/2010/09/creating-roller-coaster-in-blender-25_08.html

*NOTICE* This tutorial will not work in 2.55 beta, as there is a bug where the camera won't move when using the Follow Curve constraint.  You will need to either download blender 2.54 beta, 2.53 beta, or download a patch for this bug, which I can't currently find, but I've seen it somewhere before.  Sorry about this, and I suspect this will be fixed in 2.56

In this tutorial I will be teaching you how to animate a camera on the tracks.  Let's start by first deleting the camera (X).  Now select your curve (Right-Click) and center the cursor on the starting point of the curve (Shift S - Cursor to Selected), then add a camera (Shift A - Camera).  Now click on the Constraints button:


And add a 'Follow Path' constraint.  Click on the orange cube in the new panel that just appeared, and select the name of your curve.  Next, select the 'Follow Curve' option, then rotate the camera 280 degrees along the Y axis (R - Y - 280), and move the camera up the Z axis (G - Z - 0.3).  If you go into camera view now (0), and press Alt A, you should move along the roller coaster track as if you were actually in the roller coaster.  There are probably some rotation problems, like riding along the side of the track as shown below:


But at the time I'm not sure how to fix this; sorry if this disappoints you, and in the mean time I'll try to figure out how to solve this problem.

As far as the actual ride goes, you'll probably realize you're moving extremely fast (though this will depend on the size of your roller coaster).  Select your Curve, and click on the Object Data button.


Under the panel named 'Path Animation', change the number from 100 to whatever number you want.  The higher the number, the slower the roller coaster will go.  Whatever number you change it to, you have to do the same to the number underneath the timeline at the bottom.


As shown above, I've changed mine to 500.

You may have noticed that the camera is moving at a constant speed; real roller coaster cars don't do that, so we'll take a look at how to change that.

Start by going to frame number 0.  The frame number is to the right of the End frame as shown in the image above.  Next (making sure you have your curve selected) move your mouse over the option that says 'Evaluation Time', and press I on your keyboard.  If you did it correctly, the box should now have turned yellow.


Now go to the frame where you want there to be a change in speed.  In my case, it's frame number 30, where I want there to be a slight drop in speed as the camera is moving up.  Type in that frame number, then type in the same number in the evaluation time box and press I again.  For time's sake, I'm only going to do these frames, since I'm only giving a demonstration.  Now split the window by clicking and dragging to the left the button shown below:


Change the window type to the Graph Editor by clicking the gray cube in the lower left corner of the new window, and selecting the option from the menu.  You should see something like this in the center (you'll probably need to zoom out some to see all of it):


This is an animation curve; we can control the speed of the camera by editing it.  Select the top orange handle by right clicking it, move it over to the right some (G - X), and that slows down the camera!  The farther to the right you move the curve, the slower it gets, and the farther left, the faster it gets.

That's all for this tutorial; congrats on completing it!  If you have any questions, comments, or problems, post them in the comments below.  Thanks for reading, and as soon as I figure out how to solve the rotation problem, I'll make a post about it.

9 comments:

  1. thanx for this tutorial.
    i followed it good.

    ReplyDelete
  2. You're welcome; I'm glad you liked it!

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. very nice Tutorial

    Sorry for that deleted Comment but i tought i found out how to solve the camera problem. But its only a bit better.

    :) TML

    ReplyDelete
  5. Thanks! Yeah, I really wish I knew how to fix it. Sorry about that!

    ReplyDelete
  6. Hi Ben

    I think i have a fix for that problem. Thats what i did:

    I took a cylinder and made it the active camera. Then i put a Empty slightly in front of it.The Empty drives in Front of the Train over the Track. Then i put a Track to constraint to the Train. He points always to the Empty in Front of it. That makes a nice centered view.

    If you want to see the result just write back :)

    Have a nice day

    ReplyDelete
  7. That sounds interesting; it also sounds like it works ;) Thanks!

    ReplyDelete
  8. the way you can solve this is very simple
    i'm not completely sure what the problem is here because i tried to model a complete train
    but i did get a very similar problem

    the way i solved it is to not parent the camera directly to the track
    i used a plane that was parented to the track by means of a curve modifier
    then the camera was parented to that plane
    after that i got the same problem, but it was very simply solved by just rotating the planes 90 degrees

    if you wanna know more then just reply
    i'll check back every so often

    ReplyDelete
  9. Thanks for tutorial. I just found a related movie who shows, how to run carts on the roller coaster. No sounds, so little hard to watch, but explains everything.

    train on path

    ReplyDelete