Problem with Scale

SiWi

21-08-2007 10:18:26

I have a little Problem creating my CharacterController Demo with NxOgre:
self.World = nxogre.World("Log: html")

self.Scene = self.World.createScene("Main", self.SceneMgr,"gravity: yes, floor: yes")

self.Scene.createActor("FakeFloor", nxogre.CubeShape(100,2.1,100), ogre.Vector3(0,-0.05,0), "static: yes")

self.character = self.Scene.createCharacter("Char", ogre.Vector3(0,4,0), "type: box, dimensions: 1 2 1")
self.character.attachMesh("Cube.1m.mesh")
Scale = ogre.Vector3(1,2,1)
self.character.getNode().scale(Scale)


I get the TypeError: Vector3 object is not callable.
I think there is a mistake from me not a PythonOgre bug.

SiWi

21-08-2007 11:27:42

I´m working with Cakebox in the CharacterController Tutorial. The only things I change from the Cakebox demos are the start function here and above and the onFrame Fuction here.
I outcomented the lines causing a error in the code above to do the rest of the code:
def start(self ):
self.World = nxogre.World("Log: html")

self.Scene = self.World.createScene("Main", self.SceneMgr,"gravity: yes, floor: yes")

self.Scene.createActor("FakeFloor", nxogre.CubeShape(100,2.1,100), ogre.Vector3(0,-0.05,0), "static: yes")

self.character = self.Scene.createCharacter("Char", ogre.Vector3(0,4,0), "type: box, dimensions: 1 2 1")
self.character.attachMesh("Cube.1m.mesh")
#Scale = ogre.Vector3(1,2,1)
#self.character.getNode().scale(Scale)
self.character.getNode().attachObject(self.Decoration.getCamera())
self.Decoration.getCamera().setPosition(0,1.8,0)
self.ms = self.InputHandler.getMouseState()

def onFrame(self, _time) :

q = ogre.Quaternion()
q.FromAngleAxis(ogre.Radian(self.ms.Y.rel * -0.13),self.character.getGlobalOrientation() * ogre.Vector3.UNIT_Y )
#q = self.character.getGlobalOrientation() * q


If I don´t outcomment the line q =self.character.getGlobalOrientation() * q
the code crashes with Python.exe isn´t running properly anymore.
The last thing ogre does is loading Cube.1m.mesh.
The rest of the code is working.

SiWi

21-08-2007 17:22:02

I wanted to work on with Terrain Tutorial instead, but I have a problem with creating a TerrainShape. When I do
shape = nxogre.TerrainShape("terrain.png", 4096, 150, 513, 513)
I get an Boost::Python C++ Signature is not matching error.
I think this means I´ve passed the wrong arguments. I took this arguments from C++ and there they should be the right. I also looked in the documentation, but I don´t understand the arguments for TerrainShape written there. The terrain image is loaded correctly before with ogre, because I´m using the Terrain demo code for this.
So learn me how to understand the documentation or what´s wrong with my code.

andy

21-08-2007 20:47:38

For arguments TerrainShape takes a string (input file), an int (max height)and optionally a NxOgre::ShapeParams (for options?)

Cheers
Andy

SiWi

23-08-2007 10:07:05

You have to define a ShapeParam and you can optionally pass it as last argument. With the ShapeParam you can for example scale the terrain. I still have some nxogre related problems, but I think I will have the terrain tutorial finished soon. Do you have any ides for the other problems?