WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-02-2007, 01:07 PM
TunTun TunTun is offline
Member
 
Join Date: May 2007
Posts: 16
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.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC