WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 05-13-2008, 12:47 AM
aznan aznan is offline
Member
 
Join Date: Apr 2008
Posts: 11
Dammit! Okay, one final question:
I run my cave, close it, and run it again several times in a row, not touching the code between the runs. Some runs the stereo projection is good, while on others the right and left image gets swapped. This swapping is no longer affected by things that steals CPU time, like before. It seems to occur completley at random. Here is the current code I'm using:

Code:
def updateView(self):		
	pos = ppt.getPosition()
	
	# vector from head's position to the table
	invec = origo - vec.vector(pos)
	invec = vec.normalize(invec)
	
	# z vector on the imaginary plane where invec is the y vector
	upvec = [invec.data[0],math.sqrt(1-invec.data[1]*invec.data[1]),invec.data[2]]
	upvec = vec.normalize(vec.vector(upvec))
	
	# x vector on the imaginary plane where invec is the y vector
	svec = vec.normalize(vec.cross(invec, upvec))
	
	# calculate the eyes' positions by moving them along the x vector
	lpos = move(pos, svec, self.IPD/2)
	rpos = move(pos, svec, -self.IPD/2)
	
	# update viewing positions
	self.cave.update(leftPos=lpos, rightPos=rpos)
	viz.MainView.translate(pos)

def move(point, vector, distance):
	data = []
	for i in range(3):
		data.append(point[i] + vector[i]*distance)
	return data

vizact.ontimer(0,view.updateView)
Do you have any idea what might be causing this?
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 01:36 PM.


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