TER2BLEND  

    
  
  TERRAIN TUTORIAL



Before you begin lesson 1:download the tutorial files



1. Things to be done in TERRAGEN.

  1. Start Terragen and create a heightfield. Save it as a .ter file.

    Put the .ter file in a directory of your choise and give it a name.

  2. Create your Terragen picture as usual and render it. The following parameters need to be written down on a paper. You will need them later in Ter2Blend.



    • camera position x
    • camera position y
    • camera position z
    • camera orientation head
    • camera orientation pitch
    • camera orientation bank
    • image size width (in pixels)
    • image size height (in pixels)  
    • sun heading
    • sun altitude
    • water level (if needed)


    IMPORTANT REMARKS:
     
    1. TER2BLEND WORKS ONLY WITH TERRAGEN TERRAIN UNITS!
    2. DON'T CHANGE THE ZOOM/MAGNIFICATION OF TERRAGEN'S CAMERA (1.414) 
    3. DON'T WORK WITH TERRAINS BIGGER THAN 257 X 257.

  3. Save your rendered picture to a directory of you choice and give it a name (e.g. picture.bmp). Terragen pictures are saved as bmp files.

    O.K. that was it for Terragen.


2. Things to be done in your favorite paintprogram.

This is simple. Start your favorite paint program (PSP, PS, GIMP,...) and open the bmp file you saved of your rendered picture. Save it as a TGA file. This conversion is necessary because Blender can't read bmp files.


3. Things to be done in BLENDER.

So far so good. Fasten your seatbelts, now the serious stuff...

  1. Double click on the ter2blend.blend file or start Blender and open (with F1) ter2blend1.2.blend. You get something like this (1024 x 768 screen resolution). The scene contains already a camera, two lamps representing the sun and a small mesh with the "shadow only" material attached to it, location (0,0,-1000).

    Looks complicated, isn't it? Fortunately the right script is already selected.
    But first we have to do some preparations before we can start Ter2Blend.

  2. REMARK: This step is not necessary and only cosmetic. It is even useless if you are going to use the Camera script.

    Load the rendered Terragen picture into the background of the 3D window.

    • Move the mouse into the 3D window so that the window get active.
    • push shift F7 .
    • Click the Load button and go to the directory where you have put the bmp file. Load the picture (click on it and push enter )
    • go back to the 3D window: push shift F5 . Now we can see the picture in the background of the 3D window.

      VERY IMPORTANT: the Blender camera lens must be 22.70 .
      Otherwise the Blender scene won't fit the Terragen picture!!

  3. Now we have to put the TGA-picture made by Terragen in the backbuf of Blender.

    • If you open ter2blend.blend then the Display Buttons Windows will already be displayed in the window at the bottom. If not then move your mouse to the bottom window to make it active and push F10 or this button:
    • Now push that highlighted little button on the left. load your picture in the backbuf using the same method like you did for putting the picture in de background. The Backbuf button must be active.

    • While we are in the Display Buttons Windows we can put the right settings for the camera. While we were rendering the image in Terragen we wrote down the size of it. Fill in the right coordinates in these fields:

  4. Now it becomes time to start the Ter2Blend script!

    • Move the mouse to the upper right window with the Ter2Blend script to make the window active.
    • Now push alt P , the python script is started.
    • The window shows now the userinterface of Ter2Blend.

    • Click on the Open button and give the full path and the name of the ter file.
      (e.g. c:\windows\desktop\terrain.ter).

    • Fill in the camera position and camera orientation. Do this by shift left clicking the number buttons, clear the old value with shift backspace and fill in the matching coordinates.

    • Fill in the waterlevel and the sun's heading and altitude in the slider buttons. You can use the slider to change the values or you can left click on the non-slider-side of the button and edit the value.

    • The only thing left now is to push that draw button.

    • Now let the computer work. A progress bar will inform you how far the calculations are from completion. On my machine (PII 450) it takes about 8 seconds. When finished push the Exit button of the Terrain script.

      Finally you get a mesh fitting the Terragen terrain, a plane representing the water, two lamps simulating the sun placed on the right altitude and heading and a camera on the same place as the Terragen camera.

      The 3D window has change in something like this:

      This view is the cameraview (Numpad 0 ). You can change the view by pressing the following Numpad keys: topview 7 , frontview 1 , rightview 3 . Changing between perspective and ortho view: Numpad 5 .

  5. Ter2Blend has done its work. Now we have to do some last preparations before we can begin Blendering...

    • The pink line is the border of the plane representing the water level. It is pink because it is selected for the moment. Here we don't need the water so we are going to delete it. The 3D windows must be active (mouse). Push the X button and push enter . The pink rectangle will be deleted.

    • Now select the terrain. Do this by clicking with the right mouse button. The colour of the grid will change to pink.

    • Go to the bottom window and activate the material buttons.
      Do this by pushing F5 or pushing
    • Select the Shadow Only material. Do this by pushing and select the right material.

      The following highlights are important for this material. Only Shadow must be active and the alpha slider can be moved to change the darkness of the shadow.

  6. At last, now we can Blender! For this tutorial we will keep it very simple. We will work with only one layer and put a very simple shape in the 3D window. It is supposed for this part of the tutorial that you can already create and place objects in Blender and do some basic lighting stuff. Later tutorials will show you how we can work with different layers and so change the shadow size, how to animate an object,...

    • Put a red UVsphere in front of the camera. Let it fly above the ground. The position of the object can be controled by pushing the Z button or the shift Z button. These buttons toggles between wire/solid or wire/shaded.

        

    • Now something difficult! The lighting of the object in Blender.
      Blender has four lamp types. But only one kind of lightsource can produce shadows: the spot light. To get good shadow results in Blender some tweaking has to be done.

      • It is a good idea to make the spotlight as small as possible so that only the blender objects are recieving light. So we are going to move the axis of both lamps to the center of our object (keeping the direction of the axis the same) and make the lightcone smaller of the spotlight.
        Select both lamps (with boxselect, key B ) and move them (key G ) so that the axis comes on the right place. The pictures show better what I mean. (for clarity the terrain mesh is hidden to another layer). Check if the light axis really goes through the Blender object by changing views (frontview, rightview, topview).

        Now make the cone of the spotlight smaller. Do this by tweaking the SpotSi slider.

      • The spot light is drawn in the 3D window with a clipping line . This line indicates the area in which the shadow calculations occur. The line is defined by the parameters ClipSta and ClipEnd .

        Our object must be located in this area. The smaller this area the better our shadow will be. You can tweak this area by changing the indicated sliders.


    • That's all folks! The only thing left is to go to the Display Buttons Window and push that RENDER button.

      If you want you can make the shadow lighter or darker. Select the spotlight, tweak the Alpha slider and push that render button again.

      Just another example to show that you can put Blender objects behind the hills and mountains. Just by putting them there. I exagerated the darkness of the shadow of the Blender object just to show how beautiful it follows the terrain.

      O.K., we are now at the end of this first tutorial. In a next tutorial (give me some time) I'll explain how to change the shadow size. So we will get the impression the ball is higher of the ground.


      Go to the BASIC CAMERA TUTORIAL




top