This shows you the differences between two versions of the page.
mgl:functionreferencedrawing [2009/10/08 18:06] |
mgl:functionreferencedrawing [2022/08/30 13:40] (current) |
||
---|---|---|---|
Line 24: | Line 24: | ||
===== mglPoints2: 2D points ===== | ===== mglPoints2: 2D points ===== | ||
- | **purpose:** plot 2D points on an OpenGL screen opened with mglOpen\\ **usage:** mglPoints2(x,y,size,color) | + | **purpose:** plot 2D points on an OpenGL screen opened with mglOpen. For round dots, use mglGluDisk.\\ **usage:** mglPoints2(x,y,size,color) |
^ argument ^ value ^ | ^ argument ^ value ^ | ||
| x,y | position of dots on screen | | | x,y | position of dots on screen | | ||
- | | size | size of dots (in pixels) | | + | | size | size of dots (height of square in pixels) | |
| color | color of dots | | | color | color of dots | | ||
Line 38: | Line 38: | ||
===== mglPoints3: 3D points ===== | ===== mglPoints3: 3D points ===== | ||
- | **purpose:** plot 2D points on an OpenGL screen opened with mglOpen\\ **usage:** mglPoints2(x,y,z,size,color) | + | **purpose:** plot 3D points on an OpenGL screen opened with mglOpen\\ **usage:** mglPoints2(x,y,z,size,color) |
^ argument ^ value ^ | ^ argument ^ value ^ | ||
Line 57: | Line 57: | ||
^ argument ^ value ^ | ^ argument ^ value ^ | ||
| x0,y0 | initial position of line | | | x0,y0 | initial position of line | | ||
- | | x0,y0 | end position of line | | + | | x1,y1 | end position of line | |
| size | size of line (in pixels) | | | size | size of line (in pixels) | | ||
| color | color of line | | | color | color of line | | ||
Line 72: | Line 72: | ||
^ argument ^ value ^ | ^ argument ^ value ^ | ||
| x,y | center position of oval | | | x,y | center position of oval | | ||
- | | size | [width height] of oval | | + | | size | [width height] of oval | |
| color | color of oval | | | color | color of oval | | ||
Line 104: | Line 104: | ||
===== mglFixationCross: Cross ===== | ===== mglFixationCross: Cross ===== | ||
- | **purpose:** draws a fixation cross with no arguments, draws a fixation cross at origin (default width 0.2 with linewidth 1 in white at [0,0])\\ **usage:** mglFixationCross([width], [linewidth], [color], [origin]);\\ **alternate usage:** mglFixationCross( params ) | + | **purpose:** draws a fixation cross. With no arguments, draws a fixation cross at origin (default width 0.2 with linewidth 1 in white at [0,0])\\ **usage:** mglFixationCross([width], [linewidth], [color], [origin]);\\ **alternate usage:** mglFixationCross( params ) |
^ argument ^ value ^ | ^ argument ^ value ^ | ||
Line 130: | Line 130: | ||
| nloops | number of annuli used in polygon->circle approximation [default 1] | | | nloops | number of annuli used in polygon->circle approximation [default 1] | | ||
- | mglOpen(0); | + | mglOpen(0); |
- | mglVisualAngleCoordinates(57,[16 12]); | + | mglVisualAngleCoordinates(57,[16 12]); |
- | x = zeros(10, 1); | + | x = zeros(4, 1); |
- | y = zeros(10, 1); | + | y = zeros(4, 1); |
- | isize = ones(10,1) | + | isize = linspace(1, 8, 4); |
- | osize = 3*ones(10,1); | + | osize = isize+linspace(0.1, 2, 4); |
- | startAngles = linspace(0,180, 10) | + | colors = jet(4)'; |
- | sweepAngles = ones(1,10).*10; | + | mglGluAnnulus(x, y, isize, osize,colors , 60, 2); |
- | colors = jet(10)'; % nb! transpose | + | mglFlush(); |
- | mglGluPartialDisk(x, y, isize, osize, startAngles, sweepAngles, colors, 60, 2); | + | |
- | mglFlush(); | + | \\ |
===== mglGluDisk: Circular dots ===== | ===== mglGluDisk: Circular dots ===== | ||
Line 148: | Line 148: | ||
^ argument ^ value ^ | ^ argument ^ value ^ | ||
| x,y | position of dots | | | x,y | position of dots | | ||
- | | size | size of dots | | + | | size | size of dots (radius) | |
| color | color of dots | | | color | color of dots | | ||
| nslices | number of wedges used in polygon->circle approximation [default 8] | | | nslices | number of wedges used in polygon->circle approximation [default 8] | |