im learning Panda3D now and wanted to test the mouse support. i copy & pasted the code from the documentation(http://www.panda3d.org/manual/index.php/Mouse_Support), but the only thing i get is this error:
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Assertion failed: _has_mouse at line 65 of c:\buildslave\release_sdk_win32\build
\panda3d\panda\src\tform\mouseWatcher.I
Traceback (most recent call last):
File "mathe.py", line 56, in <module>
app = MyApp()
File "mathe.py", line 39, in __init__
x=base.mouseWatcherNode.getMouseX()
AssertionError: _has_mouse at line 65 of c:\buildslave\release_sdk_win32\build\p
anda3d\panda\src\tform\mouseWatcher.I
my Code:
from direct.showbase.ShowBase import ShowBase
from pandac.PandaModules import *
from sys import exit
from direct.interval.IntervalGlobal import *
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
base.disableMouse()
'''props = WindowProperties()
props.setCursorHidden(True)
base.win.requestProperties(props)'''
self.guy = self.loader.loadModel("models/gadget")
self.guy.reparentTo(self.render)
self.guy.setScale(1, 1, 1)
self.guy.setPos(0, 3, 0)
alight = AmbientLight('alight')
alight.setColor(VBase4(0.1, 0.1, 0.1, 1))
alnp = render.attachNewNode(alight)
alnp.setPos(0, 0, 0)
render.setLight(alnp)
plight = PointLight('plight')
plight.setColor(VBase4(0.5, 0.5, 0.5, 1))
plnp = render.attachNewNode(plight)
plnp.setPos(0, 0, 0)
render.setLight(plnp)
self.accept('w', self.EventKeyW)
self.accept('w-repeat', self.EventKeyW)
self.accept('s', self.EventKeyS)
self.accept('s-repeat', self.EventKeyS)
self.accept('escape', exit)
render.setAntialias(AntialiasAttrib.MAuto)
def EventKeyW(self):
self.guy.setPos(self.guy, 0, -0.05, 0)
def EventKeyS(self):
self.guy.setPos(self.guy, 0, 0.05, 0)
app = MyApp()
app.run()
dont wonder, im new to Panda and Python
hope you can help me.
if something important is missing tell me please.
sorry if this is the wrong forum, i didnt know where i could post.