![]() | |
|
|
![]()
How to merge 3D scenes with Terragen animations!
In this tutorial, I will show you how to merge a Terragen animation with another 3D scene to make something that looks like this!
What you need:
First thing's first Before you actually start this tutorial, it would be a good idea to read it over first.
Building a terrain
For this tutorial, I made the terrain you see on the right! It has some low hills and water. The terrain has a size of 129x129 units.
Animating your terrain
Now that you've finished your Terragen scene, save the terrain and the world file. Minimize Terragen for now, or you can quit it.
Open Terranim or CamPath. I used Terranim but both are good and work pretty much the same way. Load your terrain (TER file). Now the fun part! Make a simple camera movement from one area to another. Try to keep the animation as simple as possible for now. For example, the camera is at the same height all the time (you can check this by opening the height graph) and not too many points on your map. For now, keep the number of frames around 50. Also, make a 'look at path' or 'target point' in the center of the terrain. That will make the camera look at that point while it's moving.
Close your scripting program and open up Terragen and your scene. Now set the size in pixels that you want Terragen to animate your animation, also set the detail. Remember that giving it more datail will make it nicer but it will take a lot longer. Load your script into Terragen, it should start up right away.
Now's a good time for a coffee break or dinner, or if your computer's as slow as mine, bedtime ;-)
Click here to view my terrain animation!
Saving the terrain animation
Once Terragen has finished rendering all the frames (it'll tell you when), open up Fast Movie Processor (or any other program that can merge BMP's into an AVI) and import all the frames you've just rendered!
Very important when you export you animation as AVI, don't use any compression! Unless you've set otherwise, the default is Cinepac or something! Scroll down to the bottom of the list (the one with cinepac, intel indeo, etc) and select uncompressed! The file will be much larger but the quality will be at it's best! That's what we need for now.
3D scene step 1
Okay, now comes the tricky part! Bare with me here! First thing you need to do is get back into Terragen and load your scene.
In the terrain window, export the terrain and chose RAW 8-bit. Now close Terragen and open your 3D application. From now on, I will refer it as Cinema4D and I will include a sidenote for other 3D programs.
You have now imported the terrain in Cinema4D. You can view it from any angle but it doesn't look to realistic, doesn't it?!? Now for the water. Use the Floor tool to create the water. There is no way of knowing for sure at what height it has to be so for now, take the level of water in TG units from inside Terragen and multiply it by 3.2 (this only works for Cinema4D, for others, you must do it by hand). Now use that number for the Floor's height. You can tweak it by hand if it's a bit off. Now you should have something that looks like the picture on the right!
3D scene step 2
Tricky part's one third over! Now for the camera movement! If you are using Lightwave, then you can use the TerraTools plugin at www.spacial-design.com to import your TGS file. Then you use it as the camera path. If not, keep reading!
Go back into Terranim or CamPath and re-open your saved path. Now, using the key combonation alt-printscreen, take a snapshot of the map window (make sure that it's selected, aka: title bar is dark blue) and quit the program. Now go into your favorite paint program (I used Photoshop) and paste in a new document. You should see your map window, neat, huh!?! Use your paint program to crop the map. Now scale the map by 200% and save it.
Back in Cinema4D (or whichever program your using), open the map screenshot and use it as a background image! In Cinema4D, you would create a new Background object and apply a material with the map screenshot. Make sure 'background visible in editor' is enabled. In Cinema4D, that would be toggled in the 'view options'. Now resize your 'top view' window so that the map background covers the imported terrain perfectly! No more, no less! You have to do it manually by dragging the corners of the window! Saving the scene from time-to-time doesn't hurt either!
Now, in the 'top view', place the camera on top of the first point of your screenshot background. Make it so that it's direction is towards that 'look at path' point from earlier-on. Now record a keyframe. Cinema4D has now recorded the position of the camera.
Now advance the timeline (if your 3D prog does not have a timeline then you need a better 3D prog) about ten frames. Drag the camera in the 'top view' so that it's on top of the second point. Turn the direction of the camera so that it's still pointing at the 'look at path' or 'center point'. Record the keyframe, advance ten frames and repeat the whole thing over untill you're at the end of your path!
Now's a good time to save! :-)
3D scene step 3
Cool animations are not made by just sitting and letting the computer do all the work! Once you have finished with the camera path, crop the timeline (if needed) and scale it so that it covers exactly the same number of frames your terragen animation has. From the 'top view' your camera should do something like this when you hit the 'play' button. Of course, it will be a different path and terrain but it should at least folow the same path Terranim or CamPath made.
Now, replace your 'snapshot' background with the Terragen AVI you rendered earlier. Now you need to set the proper height for the camera. Remember that we kept it simple when creating the path (camera travels same height all the time), so click on the first camera keyframe you recorded. Your camera should now be on top of the first point. From the 'top view', it looks okay but when you look at it from the side, it's probably all wrong. So from one of the side views, drag the camera (only along the Y-axis, don't move it from side-to-side, only up-and-down) untill it looks good in the 'camera view'.
If you can't see the background behind the terrain in the 'camera view', then switch your view to 'wire-frame' in the options. Move the camera up and down untill the imported terrain's position more-or-less matches the background. Record the keyframe. It should overwrite the already existing keyframe.
Now click on the next keyframe and move the camera again (only up-and-down). Repeat this untill you've finished all the keyframes. Once finished, it should look something like this. If not, use the clip to guide you what you have to do! Isn't this fun???? (:-P
The fun part
Alright, now the fun part! I'm assuming that your camera moves the same way as your camera did in Terranim or CamPath. It doesn't matter if it's a bit off. Get rid of the AVI background.
Here's where your imagination comes in! Imagine that this bare, flat terrain is the one in Terragen. Use your 3D building skills to create buildings, flying ships, whatever! As long as the camera's movements stay the same and you don't touch the terrain. Build like you've never built before! Or you can do something simple, I just put three sphere's and a cylinder with a metalic material. To make things more realistic, use the Terragen AVI as an environment map for shiny objects in your scene. That way, it will make metal domes with reflections of clouds and the surrounding terrain!
Two important things! In the 'top view', make sure that you have a light source that is shining in the same direction as the sun was in Terragen. Make it a constant light source at about 80-90% brightness. Another thing is to make an ambiant light with about 10-15% brightness. Or else the scene will look too hard and plastic compared to the terrain. You will probably have to change these settings later-on too! Once you are satisfied with your scene, do a test rendering with the AVI background. At this point, mine looked like this!
Preparing the scene
Okay, what you have to do now is get rid of the Terragen AVI background if it's there and replace it with a green materal. Apply the same green material to the Terrain and water. Set the shadow properties of the terrain so that it can recieve but not cast shadows. Same goes for the water.
IMPORTANT Keep tampering with the scene's environment settings and the green material untill your next rendering looks like this! Also, if the objects in your scene already have green in them (leaves, etc), you should change the green material to a blue one.
The reason is this...
Why all this green/blue?
By the way, if this tutorial proves to be too complicated for you, you should start with my begginer's tutorial first (coming soon).
So what's the deal with all this green/blue? It's simple, everything that's green (or blue but not both) will become transparent, and will be replaced with the Terragen animation. The background is green so that you will be able to see the clouds and sky, the terrain is green so that you will be able to see the textured hills, and the water is green so that you will be able to see Terragen's incredible water. What's green will turn into the Terragen AVI! Many movies use this technique! They film an actor in front of a green screen so that they can replace it with a background.
Render a final high-quality rendering of your completed scene! Make sure it has the same number of frames and same framerate as your Terragen AVI. Also remember to save it with no compression!
Almost finished
Now, you have the rendered Terragen animation, and the rendered scene with all the green in it. How to merge them together? That's easy! Open Premier!
Once in Premier, chose to create a new project and import the two final renderings! Make sure you have two video tracks. Place the Terragen scene on the lower video track and the 3D green scene on the one just above it. You may have to stretch the clips so that they are the same length, depending on the framerate you used. For example, if you used a higher framerate for the 3D scene, it will apear shorter in the Premier timeline compared to the other one. Once both clips are of the same length, select the 3D green clip and go to the 'transparencies' menu option. Or you can right-click and it will be there.
Now you have a choice of different transparencies, if you used a green material, chose 'green screen', if you used a blue material, chose 'blue screen'. Now adjust the tolerance levels untill you get the desired effect in the preview window! That being done, click on OK.
Export the movie! You can chose any compression you like! I reccomend either MPG or QuickTime Sorenson! View your finished animation.
Aftermath
It's very possible that your animation doesn't look right! If there are big black lines all araound your scene objects or they're slightly transparent, try adjusting the transparency tolerance levels again! If your objects seem to move around on the terrain, fix the camera path in Cinema4D, if your objects seem too harsh agaist the terrain, fiddle with the 3D scene's environment and lighting settings!
I experienced all of these problems! Practice makes perfect! Click here to view my final composition!
FAQ/troubleshooting
Q. My 3D program won't import my terrain no matter what file format I use!
Q. My 3D program doesn't have a timeline or keyframes!
Q. What's a keyframe/frame/import/material/script?
Mail me if you have another question and I will try to answer it! Try to give as much detail as possible!
|
![]() | |