Making a smoothly moving dot with a pre-specified coordinates

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): MacOS Catialina 10.15.5
PsychoPy version (e.g. 1.84.x): 2020.1.2
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: I want to make a dot moving according to coordinates that is an array of numbers – one column for X coordinates and the other column for Y coordinates. I’m using a stimuli function polygon in Builder. I wonder how can I put the coordinates from the excel file to the position slot in the function.



For example, this was how I tried to implement it. For the last image, I used $ infant of the coords but that didn’t work.
It’d be so glad if someone can help me out!
Thanks

$[Xcoords,Ycoords]

However, at the moment you have a dot which moves every 15 seconds, not every frame. Try setting the position to update every repeat and reduce the time to 0.05 (i.e. 20 fps). Alternatively, if the paths have an equation, you could put the parameters of each equation in the Excel file and then use a code component to calculate the position for each frame.

Best wishes,

Wakefield

1 Like

Thank you very much for the prompt respond.
I changed the time component and applied the coordinates. Now it runs but the dot doesn’t appear. For the alternative method, I couldn’t completely understand. Could you elaborate more if you don’t mind?
Thanks!

Try putting the time to 1 second to check it’s being drawn. Is anything else happening in the routine.

For the other method – how did you calculate the coordinates?

1 Like

Thank you very much.
I was finally able to solve the problem!

For the other method – the calculation of the coordinates is done by Matlab and the code is fairly complex. So I don’t know even it’s possible or not. But, if you are willing to look it up, I can share the code with you.

Can you share the code which calculates coordinates?