New to Panda, I’m trying to make some code that will enable my camera to look around with my mouse, FPS style. Any ideas how I would go about doing that?
Here is an example of the code that shows how this is done.
Without too much logic.
from direct.showbase.ShowBase import ShowBase
class Game(ShowBase):
def __init__(self):
ShowBase.__init__(self)
base.disableMouse()
self.mouse_sens = 0.05
scene = self.loader.loadModel("models/environment")
scene.reparentTo(render)
self.taskMgr.add(self.update, "update")
def update(self, task):
md = base.win.getPointer(0)
x = md.getX()
y = md.getY()
if base.win.movePoint…
1 Like