Hi,
I just started using psychtoolbox and I need some help with a very
simple movie I created.
the code is bellow:
screenNumber=0;
[window,windowRect]=Screen(screenNumber,'OpenWindow',100,[],8);
n=500;
rect=[0 0 n 150];
rect2=CenterRect(rect,Screen(window,'rect'));
waitSecs(1);
for i=1:n
w(i)=Screen(window,'OpenOffscreenWindow',0,rect);
r=[0+i 0 5+i 150];
Screen(w(i),'Fillrect',250,r);
end
loop={
'for i=1:length(w);'
'Screen(window,''WaitBlanking'');'
's(i)=GetSecs;'
'Screen(''CopyWindow'',w(i),window,rect,rect2);'
'end;'
};
hidecursor;
priorityLevel=MaxPriority(screenNumber,'WaitBlanking');
Screen(window,'FillRect');
i=0;Screen('Screens');
Rush(loop,priorityLevel);
s=diff(s);
frames2=sum(s)*FrameRate(screenNumber)-length(s)
ShowCursor;
Screen('CloseAll');
i need a simple white bar that will move along the screen on a black
background (I need the whole screen to be black), even though in line
2 I define the window to be black is still white.
Also, how can I gradually control the speed of the moving bar?
If you would by a PC computer especially for running psychtoolbox
functions, what RAM memory and video card would you buy.
Thank you very much,
german
I just started using psychtoolbox and I need some help with a very
simple movie I created.
the code is bellow:
screenNumber=0;
[window,windowRect]=Screen(screenNumber,'OpenWindow',100,[],8);
n=500;
rect=[0 0 n 150];
rect2=CenterRect(rect,Screen(window,'rect'));
waitSecs(1);
for i=1:n
w(i)=Screen(window,'OpenOffscreenWindow',0,rect);
r=[0+i 0 5+i 150];
Screen(w(i),'Fillrect',250,r);
end
loop={
'for i=1:length(w);'
'Screen(window,''WaitBlanking'');'
's(i)=GetSecs;'
'Screen(''CopyWindow'',w(i),window,rect,rect2);'
'end;'
};
hidecursor;
priorityLevel=MaxPriority(screenNumber,'WaitBlanking');
Screen(window,'FillRect');
i=0;Screen('Screens');
Rush(loop,priorityLevel);
s=diff(s);
frames2=sum(s)*FrameRate(screenNumber)-length(s)
ShowCursor;
Screen('CloseAll');
i need a simple white bar that will move along the screen on a black
background (I need the whole screen to be black), even though in line
2 I define the window to be black is still white.
Also, how can I gradually control the speed of the moving bar?
If you would by a PC computer especially for running psychtoolbox
functions, what RAM memory and video card would you buy.
Thank you very much,
german