我遇到了滚动角在 vispy 转盘相机中不起作用的问题。
def surface_3D(x, y, z, name):
canvas = scene.SceneCanvas(keys='interactive')
view = canvas.central_widget.add_view()
view.camera = 'turntable'
view.camera.center = (0,0,0)
view.camera.fov = 50
view.camera.distance = 3
view.camera.azimuth = -90
view.camera.elevation = 30
view.camera.roll = 30 # This angle is not working
Y, X = np.meshgrid(y, x)
tray1 = np.zeros_like(X)
tray2 = np.zeros_like(X)
tray1[0,:] = 0.5 ; tray1[:,0] = 1 ; tray1[-1,:] = 1 ; tray1[:,-1] = 1
tray2[0,:] = z[0,:] ; tray2[:,0] = z[:,0] ; tray2[-1,:] = z[-1,:] ; tray2[:,-1] = z[:,-1]
surface = scene.visuals.SurfacePlot(x, y, z, shading='smooth', color='#289fd2')
surface1 = scene.visuals.SurfacePlot(x, y, tray1, shading='smooth', color=(0.5,0.5,0.5,0.2))
surface2 = scene.visuals.SurfacePlot(x, y, tray2, shading='smooth', color='#289fd2')
view.add(surface)
view.add(surface2)
view.add(surface1)
canvas.show(run=True)
im = _screenshot((0, 0, canvas.size[0], canvas.size[1]))
io.imsave('vispy_screenshot.png', im)
return
即使我给出 30 度的滚动角度,视图也不会旋转。但是方位角、仰角和中心完美地工作。
我在这里的主要目的是为了动画目的滚动相机而不是滚动坦克。(晃动研究)。