Let say you have a 3D model of a robot and you want to use it in MORSE, this page is what you are looking for. For more on 3D modeling, see Resources.
Blender is a 3D modeling software with both Photo-realistic Rendering and Game Engine capabilities. In the first case, users want verry detailed models with high definition textures. In one word, heavy models. Those are not suited for the Game Engine, where we want to get real-time rendering.
MORSE’ 3D models need to be light, with compressed textures, and as few polygons as possible.
Game Physics: see Physics page.
See Blender wiki on Physics Types for more.
Your model can be composed by different objects, but must have only one root object, the others being his children.
Let say your 3D model is in “/home/bob/models/wallE.blend”.
The best practice is to set a MORSE_RESOURCE_PATH environement variable. Containing a list of path to models accessible by MORSE, separeted by colon (:):
export MORSE_RESOURCE_PATH="/home/bob/models:/home/bob/models2012"
Your class must extend morse.builder.morsebuilder.Robot as:
from morse.builder import *
class WallE(Robot):
def __init__(self):
Robot.__init__(self, "wallE.blend")
By default, morse.builder.morsebuilder.Robot use “morse.core.robot.Robot” classpath.
If you want a specific behaviour, you need to create a class like the ones in morse.robots. This new class must implement morse.core.robot.Robot in particular the morse.core.object.Object.default_action() method.
And back in your builder script, set the classpath with:
from morse.builder import *
class WallE(Robot):
def __init__(self):
Robot.__init__(self, "wallE.blend")
self.properties(classpath="module.in.pythonpath.WallE")
Where module.in.pythonpath.WallE is a class extending morse.core.robot.Robot.
See morse.builder.robots.morserobots.SegwayRMP400 for builder and morse.robots.segwayrmp400.SegwayRMP400PhysicsClass for core examples.
Physics for wheels: Convex Hull, see Blender wiki on Collision Bounds.
Blender got huge amount of models, you can find some on Blendswap. Make sure you look in the “low-poly” category for Game Engine models.
You can also import many 3D format in Blender, for a full list, see the Import-Export Blender wiki page.
For more on Blender Game modeling, see Blender Cookie tutorials.