Hello all,
I imagine I'm making some trivial mistake but this has been driving me mad. I'm trying to draw a drifting rotated rectangle using the fillpoly command, drawing to an offscreen window and using the drawtexture command to transfer it onscreen. I pass a 4x2 list of points to fillpoly and it processes successfully, but when the screen flips nothing is drawn. I replaced the fillpoly command with a framepoly call instead, and I get a 1 pixel line connecting two of the four points. I've tried rearranging the order of the points but that doesn't change anything for me. I've used the pointlist from the 'HelloShapesDemo' script and that draws successfully during execution of my script, as do other pointlists I've found and tried. It seems to be only my point list that doesn't draw, but I can't figure out what makes my list different.
Any help would be appreciated,
thanks.
code:
Screen('Preference', 'SkipSyncTests', 2);
[windowPtr,rect] = Screen('OpenWindow',2);
[offWindowPtr, offRect] = Screen('OpenOffscreenWindow', 2, [255 255 255], [0 0 1920 1080]);
% Code for calculating bar location and vertices for each frame would go here, for simplicity I've replaced it with % the first frame's pointlist
coordinates = [976,556;1047,627;941,521;1012,592];
% To get the 1 pixel line drawn replace this call with a 'FramePoly'
Screen('FillPoly',offWindowPtr, [0 0 0], coordinates )
Screen('DrawTexture', windowPtr, offWindowPtr)%
flipTime = Screen('Flip',windowPtr);
pause()
Screen('CloseAll')