For licensing the physics technology contact licensing@rigsofrods.com

Sketchup Tutorial

From Rigs of Rods Wiki

Jump to:navigation, search

Contents


Note: SketchUp is no longer supported with up to date Plugins.

RORCAT's edit. I have made a tutorial for making models with polygons Mesh making in sketchup

Before exporting

Before you can export your model from SketchUp, you need these files:

  • Sketchup Plugins‎
    • Copy the contents of this file into the folder within Google SketchUp's program files, normally C:\Program Files\Google\Google SketchUp X\Plugins (where X is the version you have)
  • OGRE Command Line Tools
    • Save the ogre converter program onto your hard drive. Its important that you extract the file onto C:// drive so if you wanted to access it, it would be "C:\OgreCommandLineTools". If you cant then you will have to edit the file in the plugins called "ogre_config.rb", it will be obvious what you have to change. Sometimes, this folder won't appear "media" inside the OgreCommandLineTools folder, if it doesn't then create that folder inside the OgreCommandLineTools folder, inside "media" make a folder named "models" and another one named "materials", then when you export in Sketchup, it would work now.

Exporting your model

Exporting from SketchUp is fairly straight forward. Although you must first rotate your object around the red axis! Like show in the picture below:

Sketchup1.jpg

Then actually export it:

Sketchup2.jpg

Making it work

Now that you've actually exported it you will want to put it into RoR. Now for this tutorial I'm going presume that you want to make a building. A mesh for a truck is exactly the same apart from you move the files into your "trucks" folder and they don't need an odef file.

Now you can find the exported files under the "C:\OgreCommandLineTools\media" directory off your "My Computer".

Important! You will need to delete part of the material file in order for it to work. Open up the "<object_name>.material" and scroll to the bottom. You will notice a material called material "SketchupDefault". You must delete this whole section! This section to delete is shown below:

material SketchupDefault
{
   technique
   {
      pass
      {
         diffuse 1.0 1.0 1.0
      }
   }
}

Copy or move the contents of "materials" into the "objects" folder in RoR. Next copy the .mesh file out of the models folder to the same place in RoR objects. If you are using 0.37, then go to the "Resources" folder in the RoR folder, then put your material in the material zip and mesh and odef in the meshes zip.

Sketchup3.jpg

Next you need to create the odef file. Make a new text document but call it "<object_name>.odef" In that file you need to type this in replacing "<object_name>" with the actual objects name that you exported it as. The same goes for the rest of the mentions in this tutorial.

<object_name>.mesh
1, 1, 1

beginmesh
mesh <object_name>.mesh
endmesh


end

The section about "beginmesh" is the mesh that defines the collision mesh but in this situation we are just going to use the original one to save time etc. Really this should be a more basic one without any materials and much less complex, just basic boxes etc.

Now to add it into the game it might be easier to add it via the terrain editor - yes? Add your object name to editor.cfg.

Things to note

Place your model correctly

SketchUp models need to be near of the Three Axis before exporting to get a good reference pivot point, so when you are using toolkit or Truck Editor you will see the object. You will see:

Image:Sket_error_offset.JPG

You can select all objects and then create a Group (Edit Create Group from Sketch Up Menu) and then move near to the Axis center.Your final object should show more or less:

Welldone.JPG

What you see is not what you get

The thin black lines you see on SketchUp will not be shown in RoR, as the exporter only exports the faces.

No-thin-lines.jpg

RoR isn't 2D

Models that you have made must be three dimensional.

WRONG! In this picture the model is made wrong: it only has one face, and it's not three dimensional:

D-wrong.jpg

RIGHT! This is made correctly, it has 6 faces and it's three dimensional:

D-right.jpg



Backfaces

Every polygon drawn in SketchUp has two sides:
- one is white after drawing it
- and the other one is blue (or pink after clicking "Highlight Backfaces")

After converting and exporting, the white face will be visible in RoR. But even if you "paint" the blue face, it will be invisible. This face is called a backface.

Backface normalface.png


This picture shows how a wall in SketchUp should look and how it should not look:
1): RIGHT: All backfaces are "inside" the wall, you can't see them.
2): WRONG: All backfaces are outside, and visible. (The same applies to one, two or three backfaces outside)

SU BF WR.png

de:Sketchup Tutorial/de es:Sketchup Tutorial/es

How to get rid of backfaces?

To get rid of backfaces, you have to draw every wall in 3D (see pictures under the heading "RoR isn't 2D") Then you select the blue face by left-clicking it. After that, you click "Tools => Flip Backface". If you have already "painted" the wall (applied a material to it), you can click "Tools => Highlight Backfaces". This will highlight the backfaces in pink, so you can flip them. The pink color will still be in your materials list, since you do not want to export it, you can delete it.

Those pictures show how to get rid of backfaces:

First, select the backface by left-clicking it. Having done that, click "Tools => Flip Backface" to flip the backface, it will be "inside" the wall then. Of course this will only work if the wall is three dimensional, otherwise the wall will just be invisible from the other side.

Flip backface.png

Result flipping new.png

Questions?

If you have questions, feel free to ask on the forums, but be sure to use the search first!