Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
zdavis

Junior Member
Registered:
Posts: 11
Reply with quote  #1 
Hi again,

When I'm trying to give a list of coordinates for a stimulus to move across the screen using the set_object_path function, the stimulus jumps around at the start.

For example, the code:

fix = 1;
xpath = 0.01:0.01:5; %5 sec at 100FPS
ypath = 0.01:0.01:5;
set_object_path(fix,xpath,ypath);
toggleobject(fix);
idle(5000);
toggleobject(fix);

Should move the fixation point from the 0,0 coordinate to 5 degrees out in the upper right quadrant over 5 seconds.

Instead I get the fixation jumping back and forth from the start to the end and back, for a few frames before completing the rest of the path. I got the same when I used the demo code for set_object_path on the ML website moving a stim in a circle. The stim jumped around for the first few frames before following the path.

It seems that when I use set_object_path, the path index at the start gets scrambled.

Is anyone else seeing this or am I doing it wrong?

Thanks!

-Zac
 
0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #2 
This sounds like an interesting problem. My initial guess is that there's something wrong with the timing which causes the step size to be huge. I may be completely off however.

I need sometime to get back to you, I'm a little busy right now working on other codes. I'll try to take care of it by the end of this week. If you get an answer before then, please post it on this message board.
0
zdavis

Junior Member
Registered:
Posts: 11
Reply with quote  #3 
No problem.

As an update, I've found that the problem is the last 8 frames (almost always, but sometimes 7) are being played first. For example, if I take the first 8 indices of my path vector, and append them to the end of the path vector, the target moves correctly because even though the first 8 are now at the end of the vector, they get displayed first. I'm guessing it's related to how the vector loops when it's shorter than the number of frames being animated with idle or eyejoytrack.

One thing I noticed that could be related is my refresh rate is set to 100Hz, but monkeylogic's test reports a refresh rate of 102.9Hz. I'm guessing those extra frames could be the reason why it's wrapping the end of the vector to the front, but why it's playing them first, rather than looping at the end I don't know.
0
zdavis

Junior Member
Registered:
Posts: 11
Reply with quote  #4 
Any further word on this issue? I need to use the set_object_path function to translate objects on the screen for my task, but I can't always reliably predict where they'll start or end.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.