Using Google Sketchup with Ogre

From EQUIS Lab Wiki

Revision as of 04:38, 12 February 2010 by 67.193.141.26 (Talk)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

These instructions explain how to export models from Google SketchUp 7 for use in OGRE (specifically LIAV).

Exporting an Ogre Mesh from SketchUp 7

1) Download Google SketchUp 7

2) Download the SketchUp To Ogre Exporter

3) Place backface.rb, ogre_export_1_2_0b8.rb, and ogre_export_config.rb in your Google SketchUp plugins directory (C:\Program Files\Google\Google SketchUp 7\Plugins)

4) Open ogre_export_config.rb in an editor and set $g_ogre_path_meshes, $g_ogre_path_materials, and $g_ogre_path_textures to the folders where you want your meshes, materials, and textures exported. Please note, these folders must already exist as the script will not create them.

5) Set $g_ogre_convert_xml to false

6) Open the SketchUp model you wish to export, select all objects you wish to include, and under Tools select Export Selection to Mesh. If you want to monitor the export process open Ruby Console under Window.

7) Open a command prompt and use OgreXMLConvertor.exe (located in ogre-libraries\bin\release) with your mesh.xml file as your parameter. It may make sense to copy OgreXMLConvertor to the mesh export path you set in step 4 and run it from there (e.g. OgreXMLConvertor.exe _____.mesh.xml).

8) You now have a .mesh file that is usable by Ogre


Replacing The Default Avatar with Your .mesh File

1) Open the LIAV Project Solution

2) In the solution open up CAXAvatar.cpp in Source Files/Game Elements

3) Replace "robot.mesh" in line 46 with your model's filename


To Remove Animation

1) Place your .mesh and .material files inside LIAV/media/art or LIAV/media/art_condemned

2) Comment out (or delete) the following lines, line numbers do not take into account deletion

      48-50 of CAXAvatar.cpp
      75-109 of CAXAvatar.cpp
      319-320 of CAXGameState.cpp in Source Files
      327-328 of CAXGameState.cpp in Source Files
      94, 102, and 169 of CAXAvatar.h in Header Files/Game Elements

When you rebuild and run LIAV your model should now have replaced the robot as the avatar.