Trouble with tutorials on Wiki

yogsodoth

22-08-2008 03:15:23

Hi all,

I'm new to OGRE but not to Python. Trying to get the first tutorial on the Wiki working. Are they up to date? Here's my code:

import sys
sys.path.insert(0,'..')
import PythonOgreConfig

import ogre.renderer.OGRE as ogre
import ogre.io.OIS as OIS
import SampleFramework as sf

class TutorialApplication(sf.Application):

def _createScene(self):
sceneManager = self.sceneManager
sceneManager.ambientLight = ogre.ColourValue (1, 1, 1)

ent1 = sceneManager.createEntity ("Robot", "robot.mesh")
node1 = sceneManager.getRootSceneNode().createChildSceneNode("RobotNode")
node1.attachObject(ent1)

if __name__ == '__main__':
import exceptions
try:
application = TutorialApplication()
application.go()
except ogre.OgreException, e:
print e


When it launches, I get the window and the OGRE overlay with FPS etc. but it doesn't load the robot.mesh... just a plain black screen behind the overlay. Triangle count shows as 250, which seems a little low for me for a full mesh, and I can't see a thing (at this stage the tutorial says "You should see a robot").

Any idea what I'm doing wrong?

andy

22-08-2008 04:01:11

Nothing wrong with your code (a cut an paste on my machine has the robot visible)..

Do the other ogre demos work ok?
Check the ogre.log to see if the robot.mesh loaded OK
Run your code from the ./python-ogre/demos/ogre directory just to ensure you have resources etc setup correctly..

Regards
Andy

yogsodoth

22-08-2008 07:04:07

Ok, thanks for the info. From the log, it wasn't loading the mesh... checked the config and bingo, all is now well. We have robotage.

Thanks for the help!