DotStim: Possible to change dots to other shapes?

Hi Everyone,

I’m trying to create visual stimuli of many stars on a screen. To do this, I’ve been playing around with the Visual.DotStim class. I have the stimuli working quite well, so no errors implementing that class.

But, I want to replace the dots with triangles (e.g. isosceles triangles) oriented randomly. Is there any way to modify DotStim to change the shapes from dots (circles) to triangles or other shapes? So far when I look into this, it seems one has to use the ShapeStim.

Why I want to use the DotStim functions is that it is very handy to set features such as dotlife, noiseDots, dotspeed, etc.

For instance, code like this works well:

from psychopy import visual, event, core

win = visual.Window((600, 600), allowGUI=False, winType=‘pyglet’)

Initialize some stimuli

dotPatch = visual.DotStim(win, color=(1.0, 1.0, 1.0), dir=270,
nDots=500, fieldShape=‘circle’, fieldPos=(0.0, 0.0), fieldSize=1,
dotLife=5, # number of frames for each dot to be drawn
signalDots=‘same’, # are signal dots ‘same’ on each frame?
noiseDots=‘position’, # make dots stationary
speed=0.0, coherence=0.9) # stationary dots have speed 0


win.flip() # make the drawn things visible

Does anyone have any good recommendations? Or do I need to start from scratch with ShapeStim and work on randomly placing the triangles, programing their lifetime, position, etc?