View Single Post
  #6  
Old 09-06-2007, 10:33 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Based on the code you posted previously, your script will create some text file that contains a bunch of tab delimited numbers. By executing the line of code I mentioned, when the user reaches some point or when you press a button your text file will look something like this:
Code:
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
*** Reached point A
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
*** Reached point B
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
1    1.1    6.2    0.8    1.8    7.8    3.4
.
.
.
This will let you know at which point in the data the event occurred. It is up to you to know when to write this flag to the text file. If you want to add it when a key or button is pressed, then you will need to register an event callback. For example, the following code will write the flag to the file when the space key is pressed:
Code:
def WriteFlag():
	tracking_data.write('*** Reached point A\n')
vizact.onkeydown(' ',WriteFlag)
If you want to add it when the user reaches some location, then you will need to manually detect if the user has reached the checkpoint, then write the flag to the file. Hope this clears it up a little, let me know if you still have questions.
Reply With Quote