The newbie is back

chriso

17-05-2007 22:32:02

Back in 2005 I started exploring how I could switch from using Shockwave 3D into Ogre, but had no c++ experience and thought that Python would be easier to learn for quicker results, so tried pyOgre. After a short while I got frustrated at the lack of documentation, using notepad to edit python files, no easy to use physics, code crashing without warning etc. I dropped it and became too busy on other things. I had started documenting it here:
http://pyogre.blogspot.com/

Now I'm back. I'm pleased to see Python Ogre picking up speed. I've looked through a lot of the demos. I'm now using Stanis Python Editor and am impressed by the physics integration.

Here is my simple first test, showing a robot on the stage


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

class oopTest(sf.Application):
def _createScene(self):
sceneManager = self.sceneManager
camera = self.camera

sceneManager.ambientLight = [1,1,1]

ent = sceneManager.createEntity("Robot", "robot.mesh")
node1 = sceneManager.rootSceneNode.createChildSceneNode("RobotNode")
node1.attachObject(ent)


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


Dont bother running it, its a pointless hello world app :)

chriso

17-05-2007 22:36:35

so anyway, I wanted to ask for assistance on two things.

1) creating a clean framework. The samepleframework seems to loads lots of assets in.

At the moment, I am creating test files within c:PythonOgre\demos\ogre

if I want to work in a seperate folder, which files do I need to include?
ogre.cfg & plugins.cfg & resources.cfg & SampleFramework.py

What exactly does SampleFramework do?

What do I need to load in resource.cfg

2) whats the best working practice for a clean folder structure?

3) How can I get rid of the ogre logo and fps count?

Many thanks

bharling

18-05-2007 15:52:02

Hello,

The TechDemo project is really an attempt to answer your questions, unfortunately it's not complete yet, but feel free to download the SVN version and have a look.

Here's some brief textual answers to your questions:

1. Sample Framework is specific to the demos, you do not have to use it if you dont want to. It's purpose is to provide a basic environment into which the demo content is added. It simply includes code to load resources, setup framelisteners and run the rendering engine.

2. Again, have a look at the techdemo, it's a self contained project with all files included to make it run without the sample framework.

3. Logo and fps are displayed via an overlay script. As a very quick fix to get rid of it, (if you are using the sampleframework) you can just pass self.frameListener.showDebugOverlay(False) in your createScene method.

One day the techdemo will be finished, and properly commented to demonstrate the answers to all your questions (and a lot more features as well) ..