land
13-03-2008 16:08:42
hello, everyone~
I followed the basic tutorial 2, the code is like this:
when running the code, after the ogre dialog showing, the error show up:
Traceback (most recent call last):
File "/home/username/workspace/test/src/basic_2.py", line 22, in <module>
ta.go ()
File "/home/username/python_ogre/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/sf_OIS.py", line 65, in go
self.root.startRendering()
File "/home/username/python_ogre/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/sf_OIS.py", line 309, in frameStarted
self._moveCamera()
File "/home/username/python_ogre/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/sf_OIS.py", line 436, in _moveCamera
self.camera.yaw(self.rotationX)
AttributeError: 'NoneType' object has no attribute 'yaw'
Unregistering ResourceManager for type BspLevel
*-*-* OGRE Shutdown
But I tried to type some code to replace the "pass"in the "def _createCamera (self)" section, the program was ok to run. Like this:
Could anyone explain that? Thanks.
my development enviroment:
OS: Ubuntu 7.10
IDE: eclipse
The python-ogre svn source code was downloaded and compiled about 2 weeks ago.
I followed the basic tutorial 2, the code is like this:
import ogre.renderer.OGRE as ogre
import SampleFramework as sf
class TutorialApplication (sf.Application):
def _createScene (self):
pass
def _createCamera (self):
pass
def _createViewports (self):
pass
if __name__ == '__main__':
ta = TutorialApplication ()
ta.go ()
when running the code, after the ogre dialog showing, the error show up:
Traceback (most recent call last):
File "/home/username/workspace/test/src/basic_2.py", line 22, in <module>
ta.go ()
File "/home/username/python_ogre/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/sf_OIS.py", line 65, in go
self.root.startRendering()
File "/home/username/python_ogre/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/sf_OIS.py", line 309, in frameStarted
self._moveCamera()
File "/home/username/python_ogre/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/sf_OIS.py", line 436, in _moveCamera
self.camera.yaw(self.rotationX)
AttributeError: 'NoneType' object has no attribute 'yaw'
Unregistering ResourceManager for type BspLevel
*-*-* OGRE Shutdown
But I tried to type some code to replace the "pass"in the "def _createCamera (self)" section, the program was ok to run. Like this:
def _createCamera (self):
self.camera = self.sceneManager.createCamera ('PlayerCam')
self.camera.position = (0, 150, -500)
self.camera.lookAt ((0, 0, 0))
self.camera.nearClipDistance = 5
Could anyone explain that? Thanks.
my development enviroment:
OS: Ubuntu 7.10
IDE: eclipse
The python-ogre svn source code was downloaded and compiled about 2 weeks ago.