WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-13-2009, 09:17 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
Stickydots

Dear users,

A while ago there was a post suggesting a vizard plugin available called stickydots (available at http://mirror.optusnet.com.au/sourceforge/v/vi/vizard/)

I can no longer find anything at this link. Does anyone know of any more recent plugins? Or, another method of creating some random dot motions in vizard?

Many thanks.

JB
Reply With Quote
  #2  
Old 01-13-2009, 05:10 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I've attached the most recent version of the plug-in, including a sample script. Hope this helps.
Attached Files
File Type: zip VizardStickyDots.zip (7.4 KB, 450 views)
Reply With Quote
  #3  
Old 01-14-2009, 09:02 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
Dear Farshizzo,

Thank you for this, although I don't think I'll be able to do what I want with this plugin looking at it.

I want to create a circular patch at a certain point on the screen filled with 500 dots. I want these dots to then move randomly in direction for 300ms at a certain speed and then disappear. This a control condition for an experiment which contains structured dot balls, so I need to make sure this particular condition has no decipherable structure and the movement appears random.

I could create lots of dots separately, but this I presume is going to be too computationally demanding. Could you offer any advice as to the best route to take with this sort of problem?

Many thanks.

JB
Reply With Quote
  #4  
Old 01-16-2009, 03:19 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can create an On-The-Fly object that renders points and modify the position of each point every frame. If you are concerned about performance, then you can create a vertex shader that performs all the animating of the points directly on the GPU. If you are only rendering 500 points, then you could get away with just using an On-The-Fly object, depending on how fast your computer is.

Have a look at the example for creating On-The-Fly geometry and let me know if you have any more questions.
Reply With Quote
  #5  
Old 01-20-2009, 03:59 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
Hi,

Thanks, this has been really useful. I was just wondering however, if there is some command which resets to the orignal vertex values in the code.

The relevant section is here

HTML Code:
# for backward trials
			if Mot_sel < 2:
				R_spd = 0.0
				Z_spd = 0.0
				L_spd = 0.0
				ball1.clearAttribute(viz.ATTR_VERTEXPROGRAM,op=viz.OP_OVERRIDE)
#			# for rotation trial
			if Mot_sel == 2:
				Z_spd = 0.0
				L_spd = 0.0
				B_spd = 0.0
				Z_st = Z_pos[0,0]
				X_off = Side_id*X_offset[0,0]
				####Create random dot motion
				ball1.dynamic()
				def mytimer(num):
						#Change the position of a vertex
							for i in range (0, NUM_DOTS):
								x = random.random() - 0.5
								y = random.random() - 0.5
								z = random.random() - 0
								length = math.sqrt(x*x + y*y + z*z)
								x = x / length * RADIUS
								y = y / length * RADIUS
								z = z / length * RADIUS
								ball1.setVertex(i,x,y,z)
				viz.callback(viz.TIMER_EVENT,mytimer)
				viz.starttimer(0,0.2,viz.FOREVER)
				
So for mot_sel == 2 trials I have managed to create randomly moving dots withing a flatten ball (setting z to 0) for the mot_sel < 2 trails I want to reset the balls back to being spherical. Inserting the orignal dotball code at this point gives me a timing error for my trails. Is there a less computationally demanding way of doing this. I've tried some clearAttribute functions but not sure if I'm selecting the right command as I can't find much on these in the vizard help section.

My entire code is too long to post. Let me know if this would be useful for you.

Thank you.

Best, JB
Reply With Quote
  #6  
Old 01-21-2009, 11:29 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
There is no command that will reset each vertex position to its original value. You will need to save the original values in a list and then manually apply them to each vertex when you need to reset them.
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


All times are GMT -7. The time now is 02:41 AM.


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