nLines is just a number of lines and lineWidthDeg is the width of the lines in degrees, lineLengthDeg is the line length in degrees.
With this I still get aliasing even though interpolate=True is the default.
Perhaps a simpler question is how to get just a single anti-aliased line using gratingStim, i.e.
I am not, this is just running on my Mac laptop for testing right now. But doesn’t seem to make a difference whether I set it to True or False.
Just for the record, this is my call to Window
It seems like shape only allows for connected lines (without some sort of hack where you draw a bunch of lines that are the same color as the background). Is this correct? If so is there a better way to do something like this image?
@mdc@djmannion Thank you for all your help so far. I was aware of the Line function but I would like to be able to present up to 200 lines (not just 10) at once and flicker them. It seems like the only way to present multiple lines using Line is in a for loop (like @djmannion suggested) but with 200 lines it ends up dropping several frames. This was my original reason for trying to use ElementArrayStim but I ran into the anti-aliasing issue. Is there any way to create an array of lines and present it without a for loop? Or is there any other way to get something that works like DrawLines in psychtoolbox (http://docs.psychtoolbox.org/DrawLines)?
You could write some custom OpenGL code to get functionality like PTB’s DrawLines. But, perhaps your ElementArrayStim approach could work sufficiently if you do the anti-aliasing beforehand? For example (using skimage):
If you are using the newest version of PsychoPy with pyglet, you might be able to switch on MSAA to get anti-aliasing. Use the multiSample=True and numSamples=8 or 16 when starting your window (make sure useFBO=False). Keep in mind MSAA results in a performance hit on older graphics hardware and is a bit different visibly than the usual alpha blending technique.