To see this in action, we're going to set the camera's heading and pitch based on where the mouse is in the window.
cycleControl()method right above the call to
if(base.mouseWatcherNode.hasMouse() == True): mpos = base.mouseWatcherNode.getMouse() base.camera.setP(mpos.getY() * 30) base.camera.setH(mpos.getX() * -30)
chp04_07.pyand run it.
Now, the camera snaps to a new rotation based on the position of the mouse in the window. To be specific, the new rotation is equal to a percentage of 30 degrees according to how ...