Ejemplo n.º 1
0
    def __init__(self, win):
        self.win = win
        self.degree = 2 * math.pi / 60
        self.radius = 20
        self.pointSegments = []

        for i in range(61):
            x = self.radius * math.sin(i * self.degree)
            y = self.radius * math.cos(i * self.degree)
            self.pointSegments.append((x, y))

        self.pathSegments = []

        lastX = self.pointSegments[0][0]
        lastY = self.pointSegments[0][1]
        for (x, y) in self.pointSegments[1:]:
            path = shape.ShapeStim(win,
                                   units='pix',
                                   vertices=((lastX, lastY), (x, y)),
                                   lineWidth=2,
                                   closeShape=False,
                                   lineColor='white',
                                   autoDraw=False)
            lastX = x
            lastY = y
            self.pathSegments.append(path)
Ejemplo n.º 2
0
 def __init__(self, win, vertices, lineWidth=1.5):
     self.win = win
     self.clue = shape.ShapeStim(
         win,
         units='pix',
         vertices=vertices,
         lineWidth=lineWidth,
         closeShape=False,
     )
Ejemplo n.º 3
0
from psychopy import visual, event, core
from psychopy.visual import circle, shape, line
import random, math

win = visual.Window([900, 900], monitor="testMonitor", units="cm")
#dot = visual.DotStim(win,dotSize=4.0)
fixation = shape.ShapeStim(win,
                           vertices=((0, -0.2), (0, 0.2), (0, 0), (-0.2, 0),
                                     (0.2, 0)),
                           lineWidth=1,
                           closeShape=False,
                           lineColor='white',
                           autoDraw=False)
verLine = line.Line(win, (0, 0.8), (0, -0.8),
                    units='norm',
                    lineColor='white',
                    lineWidth=0.002,
                    autoDraw=False)
horiLine = line.Line(win, (-0.8, 0), (0.8, 0),
                     units='norm',
                     lineColor='white',
                     lineWidth=0.002,
                     autoDraw=False)

circle1 = circle.Circle(win,
                        radius=0.01,
                        pos=(0.5, 0.3),
                        lineColor='red',
                        fillColor='red',
                        units='norm')