我正在尝试使用 Vizard 5 对 Oculus rift 进行模拟。当 oculus 也连接到主视图时,我无法将鼠标链接到 MainView 方法,这意味着我想让鼠标同时移动相机和 oculus。任何帮助,将不胜感激。
这是到目前为止的代码:
import viz
import oculus
import vizcam
import vizfx
import sys
import vizact
import vizinfo
viz.go(viz.FULLSCREEN)
view = viz.addView
#add Oculus as HMD
hmd = oculus.Rift()
hmd.getSensor
#links hmd to mainview, both mouse and hmd should be linked to mainview
viz.link(hmd.getSensor(), viz.MainView)
#vizcam.WalkNavigate()
#make mouse invisible and activate mainview's collision
#viz.mouse.setVisible(viz.OFF)
#collison with objects set to on
viz.MainView.collision(viz.ON)
viz.MainView.collisionBuffer(0.5)
#add model
vizfx.addChild('AutoSave_house3D model.osgb')
#add environment
viz.addChild('sky_day.osgb')
#create a sunlight
sun = vizfx.addDirectionalLight()
sun.color(1.0,1.0,0.8275)
sun.setEuler(90,90,0)
viz.go()