PyOgre Tutorial2        

PyOgre example (\Python24\pyogre\demos):

# This code is a complete OGRE application with a space sky plane
 # and a dragon in the middle of the space
 # move your camera with the mouse and use W-A-S-D keys

Don't forget to install prior to starting the example listed below:



import pyogre.ogre as ogre
 import SampleFramework as sf
 
 class SkyPlaneApplication(sf.Application):
     def _createScene( self ):
         sceneManager = self.sceneManager
         camera = self.camera
         
         sceneManager.ambientLight = (0.5, 0.5, 0.5)   
 
         plane = ogre.Plane()
         n = plane.normal
         n.x, n.y, n.z = 0, -1, 0
         plane.d = 5000
         #sceneManager.setSkyDome(True, 'Examples/CloudySky', 5, 8)
         sceneManager.setSkyPlane(True, plane, 'Examples/SpaceSkyPlane', 10000, 3)
  
         light = sceneManager.createLight('MainLight')
         light.position = (20, 80, 50) 
 
         entity = sceneManager.createEntity('dragon', 'Cube.mesh')
         sceneManager.rootSceneNode.attachObject(entity)
 
 if __name__ == '__main__':
     application = SkyPlaneApplication()
     application.go()

To run this application, go to folder C:\Python24\pyogre\demos and start one of the example applications (files ending *.py) by typing:

python SkyPlaneApplication.py