[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8.5 Primitives drawing
These commands draw some simple objects like line, point, sphere, drop, cone and so on.
- MGL command: clf
Clear the picture by removes all drawing from it. Does not change transformation matrix.
- MGL command: ball
x y
['col'='r'] - MGL command: ball
x y z
['col'='r'] Draws a point (ball) at position {x, y, z} with color defined by string col.
- MGL command: line
x1 y1 x2 y2
['stl'=''] - MGL command: line
x1 y1 z1 x2 y2 z2
['stl'=''] Draws a geodesic line (straight line in Cartesian coordinates) from point {x1,y1,z1} to {x2,y2,z2} using line style stl.
- MGL command: curve
x1 y1 dx1 dy1 x2 y2 dx2 dy2
['stl'=''] - MGL command: curve
x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2
['stl'=''] Draws Bezier-like curve from point {x1,y1,z1} to {x2,y2,z2} using line style stl. At this tangent is co-directed with {dx1,dy1,dz1}, {dx2,dy2,dz2} and proportional to its amplitude.
- MGL command: facex
x0 y0 z0 wy wz
['stl'=''d1=0 d2=0
] - MGL command: facey
x0 y0 z0 wx wz
['stl'=''d1=0 d2=0
] - MGL command: facez
x0 y0 z0 wx wy
['stl'=''d1=0 d2=0
] Draws the solid rectangle (face) perpendicular to [x,y,z]-axis correspondingly at position {x0, y0, z0} with color stl and with widths wx, wy, wz along corresponding directions. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Parameters d1!=0, d2!=0 set additional shift of the last vertex (i.e. to draw quadrangle).
- MGL command: sphere
x0 y0 r
['col'='r'] - MGL command: sphere
x0 y0 z0 r
['col'='r'] Draw the sphere with radius r and center at point {x0, y0, z0} and color stl.
- MGL command: drop
x0 y0 dx dy r
['col'='b'sh=1 asp=1
] - MGL command: drop
x0 y0 z0 dx dy dz r
['col'='b'sh=1 asp=1
] Draw the drop with radius r at point {x0,y0,z0} elongated in direction {dx,dy,dz} and with color col. Parameter sh set the degree of drop oblongness: ‘0’ is sphere, ‘1’ is maximally oblongness drop. Parameter asp set relative width of the drop (this is analogue of “ellipticity” for the sphere). See section Drops sample, for sample code and picture.
- MGL command: cone
x1 y1 z1 x2 y2 z2 r1
[r2=-1
'stl'=''edge=off
] Draw tube (or truncated cone if edge=
off
) between points {x1,y1,z1}, {x2,y2,z2} with radiuses at the edges r1, r2. If r2<0 then it is supposed that r2=r1. The cone color is defined by string stl.
- MGL command: rect
x1 y1 x2 y2
['st'=''] - MGL command: rect
x1 y1 z1 x2 y2 z2
['st'=''] Draw rectangle from point {x1,y1,z1} to point {x2,y2,z2} using colors stl. If stl have 4 or more colors then it defines colors for each rectangle vertex (useful for making gradients, like ‘wwrr’) else first color is used for whole rectangle.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |