Welcome to the new Ogre Wiki!
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
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:
- Python 2.4
- Psyco
- PyOgre (Media + PyOgre)
(unzip the media folder to C:\Python24\pyogre\demos)
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
Contributors to this page: jacmoe
and
OgreWikiBot
.
Page last modified on Thursday 31 of December, 2009 03:29:40 GMT by jacmoe
.
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.
Sidebar
Search box
Online users
104
online users

