Importing Blender Models

Started by Henry Blewer, October 22, 2009, 11:17:53 AM

Previous topic - Next topic

Henry Blewer

Importing Objects from Blender

To start with we're going to do some basic modeling. It very simple, so don't get all 'oh no!' on me. What we are going to do is make some standing stones. They will be sort of like the stones used to build Stonehenge. If you have an object already, scroll down to the 'Exporting Blender Objects in Wavefront obj Format'.

http://farm3.static.flickr.com/2537/4034256013_cf635c0f96_o.jpg

Importing Objects from Blender

To start with we're going to do some basic modeling. It very simple, so don't get all 'oh no!' on me. What we are going to do is make some standing stones. They will be sort of like the stones used to build Stonehenge. If you have an object already, scroll down to the 'Exporting Blender Objects in Wavefront obj Format'.

Modeling Section

Let's start. The default Blender scene has a cube in the center of the 3D view. It should be outlined in pink. If it is not right click with the mouse on it. If there is not a cube there, go to the top left of the window and 'Add Mesh Cube'. Now let's stretch it out alittle to look monolithic. Press the 's' key and then the 'z' key then move the mouse up. This allows us to make the cube taller on the z axis only. Make the cube about 3 times taller than the cube was. Do this again in y axis; press '3' on the number pad then 's' then 'y' and move the mouse sideways so the cube is about twice the width it was. The keypad controls which view the 3D window displays. '1' for x axis, '3' for y axis, and '7' for the top view. '5' toggles between orthographic and perspective views. The other number keys on the key pad control the view rotation. If you are off axis, just press the 1,3,or 7 keys to return to front, side, or top views.

We are in Object mode, now we need to be in Edit mode. Press the TAB key. This toggles between the Object and Edit modes. On the bottom panel below the 3D view is the 'tool' bar. Near the top left of the panel a sqare box should be selected. It has four yellow dots on the corner. Click on this if it is not selected. Just above this is a box which should say 'Edit'. If it says 'Object' then press the TAB key to enter Edit mode. The cube should now show yellow or purple dots on the corners. These are the cubes vertexes. Press the 'a' key. The vertex colors should change, we want the vertexes to be yellow.

In the middle of the panel there is a subpanel called Mesh Tools. This is the subpanel we will be working with. Check to be sure the vertexes are yellow; press the 'a' key if they are not. Now in the Mesh Tools subpanel click on subdivide. More vertexes should appear on the cube, all yellow. This has added new faces to the cube. Now click on the Fractal button. A requester should appear, just click OK. Click on Fractal again and click OK. What just occurred is we subdivided the cube twice. The Fractal button also applies a jitter to the new vertexes locations. Now Subdivide again. Now we have enough vertexes to use the Smooth function in the Mesh Tools. Click on the Smooth button until you are satisfied with the monolith's 'roundness'.

In the Link and Materials subpanel click on Set Smooth. Now you can make as many monoliths as you like, but before you do grab the monolith and move it along the x axis. Press the 'g' key and then the 'x' key, then move the mouse left. When you think the monolith is far enough away from the axis origin left click the mouse. Press the 'a' key so all the vertexes are purple. Add an new cube, it should be yellow and repeat the above steps. After you have made a second monolith, click on the Rotation controller. It's the button two over from the Edit Mode/Object Mode selector. It should pop up and say Median Point. We want to select 3D Cursor. Now with only the new monolith selected (yellow) press 'g' and 'x' to move the new monolith on top of the first. If both monoliths are yellow press the a key so every vertex is purple. Now click on a vertex with the right mouse button. A single vertex should turn yellow. To select all the connected vertexes in the monolith press 'ALT' and 'l' at the same time. Now press 'r' for rotate, and 'z' to contrain the rotation to the vertical axis. When the monolith is rotated where you want it, left click.

Now click on new in the Link and Material subpanel. We will not worry about the color and other attributes now. This just gives us a basic material for exporting. We want to go back to Object mode now. Press the TAB key. The monolith/s should now be outlined in purple. If not, then press the 'a' key twice and right click on the monolith object. Press the '1' key on the numeric key pad to go to the front view. THe monolith object should break the x Axis plane, it's the red line in the 3D view. If it does not go back to Edit mode and press the 'a' key so all the vertexes are yellow. Then press 'g' and press 'z' and move the monolith/s so they cross this axis. About 1/3 of the object should be below this plane. Why? When the object is imported into Terragen 2, we want it to sit on the terrain correctly. I like to have 'roots' on my objects, so terrain variations (small ones) don't leave the objects floating in the air. You should see a round ball at the axis origin. This is the objects center. Terragen 2 uses this to calculate where the object sits.

Exporting the Blender Objects in Wavefront obj Format

Now we are ready to export the object. Make sure the monlith/s are outlined in purple; only the object. Click on the File Menu on the top of the 3D view. Move down to Export and then down to 'Wavefront (obj)'. It's the third choice from the bottom. This will bring a file saving window up. Give the object an unique name, monoliths. A new window will appear. Under Export, click on Edges, Triangulate, Materials, UV's, Nurbs, Normals, and HQ. Under the Blender Objects as OBJ, click Objects, Groups, and Material Groups. These should all be darker than the other buttons. Now click on EXPORT. The object should be saved in obj format.

Importing Blender Objects to Terragen 2

Make a fractal terrain which has some rolling hills. A displacement of 900 should do it. Now Click on the Objects button at the top of the page. Click on Add Object, Object, obj reader. Click on 'No' for the XFrog compatiblity. Now right click somewhere visible in the preview window and select copy coordinates. Now paste the coordinates into the translate by clicking on the 'Clipboard' icon on the right of the translate inputs. Now enter '100' on all three scale inputs. You can change this later if it's too large. I use 100 so the objects bounding box can easily be located.

Next click on the Surface Shaders tab. It should say 'Parts shader 01' Click on the icon on the right with the plus sign. Select 'Go to Parts shader 01'. A window should appear. Click on the first icon with the three boxes. This takes you to the internal network of the material/shader. The node window should show a red box which says 'Material Shader' Now you are ready to enter color and displacement functions just like you would a terrain.

That's it. This has been a lot of reading/writing, but it covers everything except using image mapping. I am not very good with that yet, so it will be another tutorial. Have fun.

Modeling Section

Let's start. The default Blender scene has a cube in the center of the 3D view. It should be outlined in pink. If it is not right click with the mouse on it. If there is not a cube there, go to the top left of the window and 'Add Mesh Cube'. Now let's stretch it out alittle to look monolithic. Press the 's' key and then the 'z' key then move the mouse up. This allows us to make the cube taller on the z axis only. Make the cube about 3 times taller than the cube was. Do this again in y axis; press '3' on the number pad then 's' then 'y' and move the mouse sideways so the cube is about twice the width it was. The keypad controls which view the 3D window displays. '1' for x axis, '3' for y axis, and '7' for the top view. '5' toggles between orthographic and perspective views. The other number keys on the key pad control the view rotation. If you are off axis, just press the 1,3,or 7 keys to return to front, side, or top views.

We are in Object mode, now we need to be in Edit mode. Press the TAB key. This toggles between the Object and Edit modes. On the bottom panel below the 3D view is the 'tool' bar. Near the top left of the panel a sqare box should be selected. It has four yellow dots on the corner. Click on this if it is not selected. Just above this is a box which should say 'Edit'. If it says 'Object' then press the TAB key to enter Edit mode. The cube should now show yellow or purple dots on the corners. These are the cubes vertexes. Press the 'a' key. The vertex colors should change, we want the vertexes to be yellow.

In the middle of the panel there is a subpanel called Mesh Tools. This is the subpanel we will be working with. Check to be sure the vertexes are yellow; press the 'a' key if they are not. Now in the Mesh Tools subpanel click on subdivide. More vertexes should appear on the cube, all yellow. This has added new faces to the cube. Now click on the Fractal button. A requester should appear, just click OK. Click on Fractal again and click OK. What just occurred is we subdivided the cube twice. The Fractal button also applies a jitter to the new vertexes locations. Now Subdivide again. Now we have enough vertexes to use the Smooth function in the Mesh Tools. Click on the Smooth button until you are satisfied with the monolith's 'roundness'.

In the Link and Materials subpanel click on Set Smooth. Now you can make as many monoliths as you like, but before you do grab the monolith and move it along the x axis. Press the 'g' key and then the 'x' key, then move the mouse left. When you think the monolith is far enough away from the axis origin left click the mouse. Press the 'a' key so all the vertexes are purple. Add an new cube, it should be yellow and repeat the above steps. After you have made a second monolith, click on the Rotation controller. It's the button two over from the Edit Mode/Object Mode selector. It should pop up and say Median Point. We want to select 3D Cursor. Now with only the new monolith selected (yellow) press 'g' and 'x' to move the new monolith on top of the first. If both monoliths are yellow press the a key so every vertex is purple. Now click on a vertex with the right mouse button. A single vertex should turn yellow. To select all the connected vertexes in the monolith press 'ALT' and 'l' at the same time. Now press 'r' for rotate, and 'z' to contrain the rotation to the vertical axis. When the monolith is rotated where you want it, left click.

Now click on new in the Link and Material subpanel. We will not worry about the color and other attributes now. This just gives us a basic material for exporting. We want to go back to Object mode now. Press the TAB key. The monolith/s should now be outlined in purple. If not, then press the 'a' key twice and right click on the monolith object. Press the '1' key on the numeric key pad to go to the front view. THe monolith object should break the x Axis plane, it's the red line in the 3D view. If it does not go back to Edit mode and press the 'a' key so all the vertexes are yellow. Then press 'g' and press 'z' and move the monolith/s so they cross this axis. About 1/3 of the object should be below this plane. Why? When the object is imported into Terragen 2, we want it to sit on the terrain correctly. I like to have 'roots' on my objects, so terrain variations (small ones) don't leave the objects floating in the air. You should see a round ball at the axis origin. This is the objects center. Terragen 2 uses this to calculate where the object sits.

Exporting the Blender Objects in Wavefront obj Format

Now we are ready to export the object. Make sure the monlith/s are outlined in purple; only the object. Click on the File Menu on the top of the 3D view. Move down to Export and then down to 'Wavefront (obj)'. It's the third choice from the bottom. This will bring a file saving window up. Give the object an unique name, monoliths. A new window will appear. Under Export, click on Edges, Triangulate, Materials, UV's, Nurbs, Normals, and HQ. Under the Blender Objects as OBJ, click Objects, Groups, and Material Groups. These should all be darker than the other buttons. Now click on EXPORT. The object should be saved in obj format.

Importing Blender Objects to Terragen 2

Make a fractal terrain which has some rolling hills. A displacement of 900 should do it. Now Click on the Objects button at the top of the page. Click on Add Object, Object, obj reader. Click on 'No' for the XFrog compatibility. Now right click somewhere visible in the preview window and select copy coordinates. Now paste the coordinates into the translate by clicking on the 'Clipboard' icon on the right of the translate inputs. Now enter '100' on all three scale inputs. You can change this later if it's too large. I use 100 so the objects bounding box can easily be located.

Next click on the Surface Shaders tab. It should say 'Parts shader 01' Click on the icon on the right with the plus sign. Select 'Go to Parts shader 01'. A window should appear. Click on the first icon with the three boxes. This takes you to the internal network of the material/shader. The node window should show a red box which says 'Material Shader' Now you are ready to enter color and displacement functions just like you would a terrain.

That's it. This has been a lot of reading/writing, but it covers everything except using image mapping. I am not very good with that yet, so it will be another tutorial. Have fun.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

old_blaggard

Nice post - it flows well and should be pretty helpful for lots of people. Perhaps you should link to it through the wiki so that it doesn't get lost in the forums as time goes on :).
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.

Henry Blewer

I will link to the wiki. I want to combine the two I have done so far first.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

inkydigit

nice one...just what I was looking for, cheers
J