| Reference | Downloads | Github

Field of dots moving in circles


I’m new to Psychopy coder and I need some help.
I’d like to create a stimulus like this example here:

Basically it’s a central field full of dots moving in circles at a slow speed, and a peripheral field of dots moving in circles at a fast speed.

I have been trying my best using the ‘dotStim’ object but it has the following limitations:

  1. The dots move in a straight line or a random walk, not in a nice circle
  2. The dots in the central field are ‘cut’ when they reach the edge of the central field - in the example they never reach the edge of the central field and thus do not get cut.

Can anyone give me tips/suggestions on which elements to use and how to set them up for a stimulus that is more like the example?

Thanks for your help!

Bumping this post, I hope someone can help with a suggestion?

Hello! please could you share the code you’ve been working with so far?! :slight_smile:

Thanks for your reply Becca!

The code I made using dotStim is nothing like the example, so I don’t think it’s worth posting here. (Unless dotStim can indeed be used to create a stimulus like the example video I posted?)

I suspect I may need to use an elementArray to achieve a stimulus like the video, but I can only figure out how to draw the stimulus and then move it as a whole on a loop, rather than each element in the array moving along a vector and having a different starting point like the video.
Here’s my very rough start at that:

globForm = visual.ElementArrayStim(win,
nElements=100, fieldSize=(300), elementTex=None, sizes=5, elementMask=“circle”)
positions = [(0,0), (0,10), (0,20), (0,30), (0,40)]
while True:
if currentpos == 5:

This code just crudely loops the array along a vertical line - to move them in circles I would write a more complex xy position vector, and to slow the speed I could duplicate each entry in that vector. But this is not what I want! I need each dot in the array to start at a different point in that vector like the example video.

Am I on the right track or should I try a different direction to achieve this?