View Single Post
  #13  
Old 05-22-2009, 02:30 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Don't give up hope yet. Clearly you have some work ahead of you, but listing what your missing is a start.

First, lets fix your stimulus presentation. Your syntax in the experiment task is incorrect. Place "yield" statments in front of 'viztask.wait' functions. Do not put a yield in front of plain functions like 'sceneOn.'

Code:
def experiment():
	
	while True:
		viz.MainScene.visible(viz.OFF)
		yield viztask.waitKeyDown(' ')
		sceneOn(1)
		yield viztask.waitTime(3)
		sceneOff()
		viztask.waitTime(10)
		sceneOn(2)
		d = viz.Data()
		yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT, d)
                pickedObject = viz.pick()
                recordTrialResponse(pickedObject, d.time)
Also i added a viz.pick call to get the geometry the mouse clicked on. It pases the result to a new recordTrialResponse function. I'ed make this function check if it was the correct object and write the results to a file.

Vizard's installation directory has an example directory called file_io that has filewriting examples. If you put a tab between each of your data points and a new line between reach response the data file should import into Matlab or Excel nicely.
__________________
Paul Elliott
WorldViz LLC
Reply With Quote