Can someone give me a tip how to make FPS-like camera rotation with mouse ?
In my program I have sth. like this :
if base.mouseWatcherNode.hasMouse():
mpos = base.mouseWatcherNode.getMouse()
if mpos.getX()>.15 and mpos.getX()<1:
self.angle += .15
if mpos.getX()<-.15 and mpos.getX()>-1:
self.angle -= .15
...
...
camera.setHpr(-self.angle, self.pan, 0)
this works, but in the middle of scrren is a square in which when you move mouse nothing happens - because without this square the camera always rotates and pans
my problem is that I need ‘smooth’ camera like in FPS games - with mouse cursor always in the middle of screen, not moving around the screen
how should I do this ? or do you know better way than returning mouse to center ? let me know…
thanks