Modelling in Google Sketchup 8 and exporting to Leadwerks Engine

Transcription

Modelling in Google Sketchup 8 and exporting to Leadwerks Engine
Modelling in Google Sketchup 8 and exporting to
Leadwerks Engine 2 using Ultimate Unwrap 3D
By Richard Simpson
Before we start, gather any textures you will use, and place them into a folder. We
will then save our sketchup file in that folder, and also add our exported files here.
Contents
1. Modelling in Sketchup
2. UU3D
3. Importing into Leadwerks
When you run Google Sketchup for the first time, you will see the welcome window. In this
window, you can view tutorials, and pick templates. We are going straight to the template
section and we will choose “simple template – Meters”. Once you have chosen this, click
on the “start using sketchup” button. (see image below)
When Sketchup first loads, you have a very basic view, with a small set of tools. We will
enable some toolbars, to get the most out of the application. See the image below for what
toolbars to enable.
Your sketchup window will now look like this. (see image below)
Now, we will start modelling. Over in the left toolbar, choose the rectangle tool (labelled 1)
and click & drag a square out in the 3D scene. Now choose the push/pull tool (labelled 2)
and click on the square face and drag up.(see image below)
Here is the result. (I deleted the female scale character by selecting the selection tool
(black mouse on the left toolbar) clicking on her, and hitting the delete key)
Time to texture this mesh! Choose the paint bucket tool in the left toolbar (top left). A small
window will pop up, here we will click the home button (labelled 1) then the “create
material” button (labelled 2) Delete all current textures in here by right clicking them and
choosing “delete”. see the image below for guidance.
Another window will now appear, in here, we can load in a texture, and change its scale.
Click on the small folder icon near the bottom, to load in your texture file. At the top of this
window enter your texture name into the text box ( I normally keep this the same as the
texture file name) See the image below for guidance.
The scale options come in handy when you want to tile a texture more or less. Button to
the side of the scale options is the “chain link”. If you break this, then you can stretch the
texture in just one direction to distort it. (see image below)
UU3D import and export
Before you start importing the sketchup mesh, you will need to get a few plug-ins from the
UU3D website. You will need the SKP importer, and the GMF exporter. The plug-ins can
be located at the bottom of the download page.
Drag your saved sketchup file over the UU3D window to load in the mesh, your window
will now look like this. (see imaged below)
in the right pane, you will see groups, materials and bones. Right click on groups and
bones, and delete all. We will leave the materials alone in this tutorial.
We wont scale or position this either, but if you do want to scale, go to:
3D Tools > Modifiers > Scene > Scale
and enter 0.0254, then click Okay.
You will then need to reposition this using the window:
3D Tools > Modifiers > Scene > Move
To export to the leadwerks format we will go to File > Save as and choose the leadwerks
format from the dropdown list. When you click save, another window appears. Because
our mesh is not animated, we will untick “export bones” and “export animation” then click
OK.
Importing into Leadwerks Engine
To get this model working in the Leadwerks editor, we need to copy our folder containing
our files into the leadwerks SDK folder. I normally put mine inside the “Models” folder.
Now that we have copied our files into the SDK folder, we can now create some material
files. To do this, run the materialeditor.exe application. On the left, we have a 3d view that
will show us our texture. On the right, we have 3 tabs: Material, Texture and Shader.
We are going straight to the texture tab. Once you have clicked on here, choose the
“texture 0” slot, and choose our texture from the dropdown menu.
Now head over to the shader tab and choose the “mesh_diffuse” shaders for the top two
dropdown boxes and hit compile. You should now see your texture on the left. (see image
below)
The material file needs to be saved with the same name as the diffuse texture.
Close the material editor and open up the Editor.exe application. Located your model in
the right pane, and drag it into the 3d space on the left. You now have a fully working game
ready mesh in Leadwerks engine! (see image below)
Note: If you have your file name as Test_Testmodel.gmf, it will appear in a folder called
“test” in the left pane. You can have as many sub folders in this as you like, by adding
more words and _ before the mesh name.
Thankyou for reading!