![]() ![]() # Change the position of the ball according to the current value of positionīall.pos = [((math.sin(position)/10) * (wheel_radius * 10)), Wheel = visual.RadialStim(win, pos=(0,0), size=((wheel_radius * 2), (wheel_radius * 2)),Ĭolor =('red', 'blue', 'white'), angularRes=300,ĪngularCycles=6, radialCycles = 0, opacity= 0.8, autoLog=False) # Noting whether the ball is deceleratingīall = visual.Circle(win, edges=100,radius=0.02, fillColor='white', lineColor=None, pos=) # Noting the starting position of the revolving ball # Specifying Window & Screen Information. # How many frames per second the animation should use # The radius of the wheel around which the ball is revolving # The speed with which the ball revolves around the wheel # Needed to calculcate the deceleration of the revolving ball # Needed to calculate the trajectory of the revolving ball # Psychopy modulesįrom psychopy import core, event, visual, gui PsychoPy can run any Python package, but a Python terminal cannot run PsychoPy code, so if you tried to run this on your own without PsychoPy, it likely will not work. PLEASE NOTE - for those unfamiliar with PsychoPy, it is a collection functions specially built for creating reseach studies and requires any code that uses it to be run in a PsychoPy terminal (rather than just any old Python terminal). Does anyone know if my suspicions about RadialStim are correct (i.e., can't use more than two colors)? Alternatively, does anyone have another recommended solution to replacing it so that I could maybe get 3 or 4 colors modeled on this larger circle? Code: Looking through the documentation, I can't see anything that helps, though, I did come across this old thread where Jon seems to suggest that it is possible, but I frankly can't make heads or tails of it and I think the OP left it unresolved as well. I'd like to be able to place more than two colors on the wheel, but I'm not sure that it's possible with visual.RadialStim. Here's a visualization of the task in action: However, that means that it evenly divides the wheel into alternating sections of color which is really helpful for my purposes. It really was designed, as I understand it, to conveniently build the spinning checkerboard visuals often used as controls in fMRI experiments. In order to model the roulette wheel (the larger circle), I used the visual.RadialStim component from PsychoPy. This function will revolve a small circle around a large circle and pressing 'space' while it is revolving will initiate an exponential deceleration in the revolution velocity of the smaller circle. I’m trying to build a function that would sort of functionally replicate a roulette wheel and I’ve essentially done so. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |