#1
|
|||
|
|||
avatar in one eye
Hi,
The system works fine for other programs, and only got problem in my code. The problem is after I put on HMD, all background look normal, I mean they are stereo. But all objects, e.g. the avatar and duck, can be seen only by one eye. Does anybody have any clue for it? My code is: import viz viz.go(viz.PROMPT) viz.clearcolor(0.5,0.5,1) ground = viz.add('tut_ground.wrl') ### Add observer model. observer = viz.add('Male.cfg') ### Add reference Model object = viz.add('Male.cfg') object.rotate(180,0,0) object.translate(0,0,7) ### Add duck Model leftHand = viz.add('duck.cfg') leftHand.scale(0.1,0.1,0.1) ### Change viewpoint to look at your feet view = viz.get(viz.MAIN_VIEWPOINT) ### Get handles to all lights ori = viz.add('intersense.dls') light1 = viz.add('vizppt.dls') # Head light2 = viz.add('vizppt.dls') # Left hand ### Manually Update The Avatar's position def mytimer(num): headOri = ori.get() data1 = light1.get() data2 = light2.get() if data1[1] > data2[1]: headPos = data1 leftPos = data2 else: headPos = data2 leftPos = data1 yaw = headOri[3] pitch = headOri[4] roll = headOri[5] viz.reset(viz.HEAD_ORI) viz.rotate(viz.HEAD_ORI, yaw, pitch, roll) x = headPos[0] y = headPos[1]-1.82 z = headPos[2] viz.reset(viz.HEAD_POS) viz.translate(viz.HEAD_POS, x,y,z) observer.translate(headPos[0], headPos[1]-1.82, headPos[2]-0.2) leftHand.translate(leftPos[0], leftPos[1], leftPos[2]) viz.callback(viz.TIMER_EVENT,mytimer) viz.starttimer(0,0.01,viz.FOREVER) ori.reset() light1.reset() light2.reset() Thanks. |
|
|