Third Person camera System

silentpolygon

08-09-2008 18:31:13

Hello everybody

right now I'm trying to set up a working Third Person camera system in Python ogre. I found not much to help me in the Python-Ogre wiki so i searched in the Ogre3D wiki and found that.

http://www.ogre3d.org/wiki/index.php/3r ... m_tutorial

Its quite good explained and i brought the player(the node and entity) into my scene but now he writes a ExtendedCamera class. I´m not too good in C++ so its quite confusing where he creates the camera actually.

For Info

I translated the Player Class( Character Class in the Example) to that

import ogre.renderer.OGRE as ogre

class Player():
def __init__(self, name, sceneManager):
self.name = name
self.sceneManager = sceneManager

# Setup Node Structure
self.RootNode = self.sceneManager.getRootSceneNode()
self.PlayerNode = self.RootNode.createChildSceneNode(self.name + '_sight', ogre.Vector3(0,0,100))
self.PlayerSightNode = self.PlayerNode.createChildSceneNode(self.name + '_camera', ogre.Vector3(0,50,-100))

# Apply Mesh to Player
self.PlayerEntity = self.sceneManager.createEntity(self.name, 'OgreHead.mesh')
self.PlayerNode.attachObject(self.PlayerEntity)

def __del__(self, name, sceneManager):

self.PlayerNode.detachAllObjects()
self.PlayerNode.removeAndDestroyAllChildren()
self.sceneManager.destroySceneNode(self.name)



any help would be great.
Espacially from people who are much better in C++ than me, which is not hard to be :-((

Thanks in Advance

EvanPMeth

08-09-2008 21:49:58

There is a python version on the wiki here:

http://wiki.python-ogre.org/index.php/3rd_Person_Camera_System_Tutorial

and here is my version with 3rd person, fullscreen toggle, mouse waypoint, shadows and fake darkness:

http://www.mediafire.com/?sharekey=60954544703d36b5d2db6fb9a8902bda


It has alot of bugs in it, but it gets the point across.

f= toggle fullscreen
wasd = move
Left mouse button on terrain to set waypoint
F1 = thridperson
F2 = helicopter view
F3 = first person

EvanPMeth

26-09-2008 03:32:47

The above third person app I made doesnt work with 1.6 rc1.
http://www.mediafire.com/?sharekey=6095 ... b9a8902bda
Cegui seems to have changed what is involved with changing it so cegui works. When running it, it complains of CEGUItinyxmlParser missing

andy

26-09-2008 04:05:19

Have a look in demos/cegui/CEGUI_Framework.py as the default parser for windows has changed -- adding the following code should help
# Another fix for CEGUI to ensure we get a working parser..
if os.name == 'nt':
CEGUI.System.setDefaultXMLParserName("ExpatParser")
else:
CEGUI.System.setDefaultXMLParserName("TinyXMLParser")


Regards
Andy

EvanPMeth

26-09-2008 18:13:21

Yep thats it, thanks andy