这段代码没有错误,但是当我运行它时,摄像机表现正常,我可以四处看。但一旦我移动,它就开始围绕其生成点旋转。
摄像机代码: http://hatebin.com/iiceqotcpu 主要代码鼠标回调函数。
摄像机代码: http://hatebin.com/iiceqotcpu 主要代码鼠标回调函数。
def mouse_callback(window, xpos, ypos):
global first_mouse,lastX, lastY
if first_mouse:
lastX = xpos
lastY = ypos
first_mouse = False
xoffset = xpos - lastX
yoffset = lastY - ypos
lastX = xpos
lastY = ypos
cam.process_mouse_movement(xoffset, yoffset)