WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-17-2009, 01:16 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
That code just goes through one trial. To see why following trials are not working I'd have to see the code you added for that
Reply With Quote
  #2  
Old 03-19-2009, 09:11 AM
mberkes mberkes is offline
Member
 
Join Date: Mar 2009
Posts: 8
I have this code for the mouseclick:

Code:
def mouseclick(button):
	if button == viz.MOUSEBUTTON_LEFT:
		object = viz.pick()
	if object.valid():
		data = 'Selected' + items
		position = object.get(viz.POSITION)
		position[1] += 1.2
		arrow.translate(position)
		arrow.visible(viz.ON)
		#record response
		response_data.write(data)
		#flush internal buffer
		response_data.flush()

viz.callback(viz.MOUSEDOWN_EVENT,mouseclick)
#go to blank scene
vizact.whilemousedown(viz.MOUSEBUTTON_LEFT,prep)
#disable mouse navigation
viz.mouse(viz.OFF)
It just goes back to prep, and I would think that it should just repeat what happened before, but no such luck. Still can't disable the mouseclick where I need to or write data, but looking into that. There's also a lot of incomplete code in there, or unnecessary code I need to get rid of (like the arrow over objects)
Reply With Quote
  #3  
Old 03-19-2009, 01:35 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
each time prep is called another vizact object is created.
Code:
def prep():
	viz.MainScene.visible(viz.OFF)
	vizact.onkeydown(' ', sceneOn,1)
The first time in prep when spacebar is pressed sceneOn gets called 1 time, if you click your mouse again and then the space bar, there are two vizact objects calling sceneOn twice, and so on. That's why more than one object is moving.

Probably the best thing to do is to re-arrange your code using viztask. Waiting for mouseclicks, keypresses, and timers can all be done within the task function. Check out the documentation on viztask and let me know if you have any questions.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Files on SourceForge farshizzo Vizard 1 09-03-2012 11:18 AM
Project .avi or .mpeg file pattie Vizard 2 02-06-2007 08:09 AM


All times are GMT -7. The time now is 09:37 PM.


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