-
Notifications
You must be signed in to change notification settings - Fork 0
/
testArc.py
67 lines (48 loc) · 1.94 KB
/
testArc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import numpy as np
from psychopy import core, event, visual, monitors
from time import time
# create monitor object for window in CM
default_gamma = np.array([[0., 1., 1., np.nan, np.nan, np.nan],
[0., 1., 1., np.nan, np.nan, np.nan],
[0., 1., 1., np.nan, np.nan, np.nan],
[0., 1., 1., np.nan, np.nan, np.nan]], dtype=float)
resolution = [1920, 1080]
size = [34.4, 19.4]
distance = 30
mymonitor = monitors.Monitor(name='temp',
distance=distance,
width=size[0])
mymonitor.setGammaGrid(default_gamma)
mymonitor.setSizePix(resolution)
win = visual.Window( screen = 0,
winType = 'pyglet',
color = [-1,-1,-1],
units = 'cm',
fullscr = True,
monitor = mymonitor)
radius = 8
width = 0.25
start = 30
end = 150
edges = 128
vertices = []
vertices += [[np.cos(a)*(radius - (width/2)), np.sin(a)*(radius - (width/2))] for a in (np.linspace(start, end, num=int(np.floor(edges/2)))/180)*np.pi]
vertices += [[np.cos(a)*(radius + (width/2)), np.sin(a)*(radius + (width/2))] for a in (np.linspace(end, start, num=int(np.ceil(edges/2)))/180)*np.pi]
arcshape = visual.ShapeStim(win = win,
units = 'cm',
fillColor = [0,0,1],
# lineColor = self.lineColor,
# lineWidth = self.lineWidth,
interpolate = True,
lineColor = [0,0,0],
lineWidth = 0,
vertices = vertices,
pos = [0,0],
ori = 0)
beginning = time()
while (time() < (beginning + 2)):
# newpos = event.mouse.getPos()
# arcshape.pos = newpos
arcshape.draw()
win.flip()
win.close()