problems with the rotations....


24-10-2006 18:55:10

hello to all. I am new using this game engine.
I was reading the tutorials. and in the final of the tutorial 1 when attempt to modify the angle of the robot, leaves programa. I dont understand because this happens :cry:
here I let to the file log to them with the file have if somebody can help me.

thanks for any aid..


25-10-2006 00:14:43

There is a problem with the way swig interprets the Degree/Radian typemap in pyOgre. For the moment the problem can be resolved by replacing instances of:


For demo:





25-10-2006 03:44:31

dermont ,thank you very much by the aid

now it works correctly... :D


25-10-2006 04:28:54

You're welcome. There is a few more instances of this in the other demos, here are the changes for the other demos.
#light.setSpotlightRange(ogre.Degree(35), ogre.Degree(50))
light.setSpotlightRange(ogre.Degree(35).valueRadians(), ogre.Degree(50).valueRadians())
#self.sceneManager = self.root.getSceneManager(ogre.ST_EXTERIOR_CLOSE)
self.sceneManager = self.root.createSceneManager("TerrainSceneManager")

if inputDevice.getMouseButton(1):
#self.camNode.yaw(ogre.Degree(-self.rotate * inputDevice.mouseRelativeX))
self.camNode.yaw(ogre.Degree(-self.rotate * inputDevice.mouseRelativeX).valueRadians())

#self.camNode.getChild(0).pitch(ogre.Degree(-self.rotate * self.inputDevice.mouseRelativeY))
self.camNode.getChild(0).pitch(ogre.Degree(-self.rotate * self.inputDevice.mouseRelativeY).valueRadians())

#node.yaw(ogre.Degree(-45)) # look at the ninja
node.yaw(ogre.Degree(-45).valueRadians()) # look at the ninja
def mouseDragged(self, evt):
self.camNode.yaw(ogre.Degree(-evt.relX * self.rotate))
#self.camNode.getChild(0).pitch(ogre.Degree(-evt.relY * self.rotate))
self.camNode.getChild(0).pitch(ogre.Degree(-evt.relY * self.rotate).valueRadians())

#node.yaw(ogre.Degree(-45)) # look at the ninja
node.yaw(ogre.Degree(-45).valueRadians()) # look at the ninja


25-10-2006 23:02:55

thank you very much dermont,
now I can continue reading the guide for beginners
all script worked correctly.
i very happy :D :D :D :D