[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.5 Primitives drawing
These functions draw some simple objects like line, point, sphere, drop, cone and so on.
- Method on
mglGraph
(C++, Python):void
Clf (mglColor
Back=WC
) - C function:
void
mgl_clf (HMGL
gr) - C function:
void
mgl_clf_rgb (HMGL
gr,float
r,float
g,float
b) Clear the picture and fill it by color Back.
- Method on
mglGraph
(C++):void
Ball (float
x,float
y,float
z,mglColor
col=RC
,float
alpha=1
) - Method on
mglGraph
(C++):void
Ball (mglPoint
p,char
col='r'
) - Method on
mglGraph
(Python):void
Ball (float
x,float
y,float
z,char
col='r'
) - C function:
void
mgl_ball (HMGL
gr,float
x,float
y,float
z) - C function:
void
mgl_ball_rgb (HMGL
gr,float
x,float
y,float
z,float
r,float
g,float
b,float
alpha) - C function:
void
mgl_ball_str (HMGL
gr,float
x,float
y,float
z,char
col) Draws a point (ball) at position p={x, y, z} with color col.
- Method on
mglGraph
(C++):void
Error (mglPoint
p,mglPoint
e,char
*pen=""
) Draws a 3d error box at position p with sizes e and style pen.
- Method on
mglGraph
(C++):void
Line (mglPoint
p1,mglPoint
p2,char *
stl="B"
,int
num=2
) - Method on
mglGraph
(Python):void
Line (float
x1,float
y1,float
z1,float
x2,float
y2,float
z2,char *
stl="B"
,int
num=2
) - C function:
void
mgl_line (HMGL
gr,float
x1,float
y1,float
z1,float
x2,float
y2,float
z2,char *
stl,int
num) Draws a geodesic line (straight line in Cartesian coordinates) from point p1 to p2 using line style stl. Parameter num define the “quality” of the line. If num=
2
then the stright line will be drawn in all coordinate system (independently on transformation formulas (see section Curved coordinates). Contrary, for large values (for example, =100
) the geodesic line will be drawn in corresponding coordinate system (straight line in Cartesian coordinates, circle in polar coordinates and so on). Line will be drawn even if it lies out of bounding box.
- Method on
mglGraph
(C++):void
Curve (mglPoint
p1,mglPoint
d1,mglPoint
p2,mglPoint
d2,const char *
stl="B"
,int
num=100
) - Method on
mglGraph
(Python):void
Curve (float
x1,float
y1,float
z1,float
dx1,float
dy1,float
dz1,float
x2,float
y2,float
z2,float
dx2,float
dy2,float
dz2,const char *
stl="B"
,int
num=100
) - C function:
void
mgl_curve (HMGL
gr,float
x1,float
y1,float
z1,float
dx1,float
dy1,float
dz1,float
x2,float
y2,float
z2,float
dx2,float
dy2,float
dz2,const char *
stl,int
num) Draws Bezier-like curve from point p1 to p2 using line style stl. At this tangent is codirected with d1, d2 and proportional to its amplitude. Parameter num define the “quality” of the curve. If num=
2
then the straight line will be drawn in all coordinate system (independently on transformation formulas see section Curved coordinates). Contrary, for large values (for example, =100
) the spline like Bezier curve will be drawn in corresponding coordinate system. Curve will be drawn even if it lies out of bounding box.
- Method on
mglGraph
(C++):void
Face (mglPoint
p1,mglPoint
p2,mglPoint
p3,mglPoint
p4,const char *
stl="w"
,int
num=2
,float
val=NAN
) Draws the solid quadrangle (face) with vertexes p1, p2, p3, p4 and with color(s) stl. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. In first case parameter val (if not
NAN
) set the color according color scheme. Face will be drawn even if it lies out of bounding box.
- Method on
mglGraph
(C++, Python):void
FaceX (float
x0,float
y0,float
z0,float
wy,float
wz,const char *
stl="w"
,float
dx=0
,float
dy=0
) - Method on
mglGraph
(C++, Python):void
FaceY (float
x0,float
y0,float
z0,float
wx,float
wz,const char *
stl="w"
,float
dx=0
,float
dy=0
) - Method on
mglGraph
(C++, Python):void
FaceZ (float
x0,float
y0,float
z0,float
wx,float
wy,const char *
stl="w"
,float
dx=0
,float
dy=0
) - C function:
void
mgl_facex (HMGL
gr,float
x0,float
y0,float
z0,float
wy,float
wz,const char *
stl,float
d1,float
d2) - C function:
void
mgl_facey (HMGL
gr,float
x0,float
y0,float
z0,float
wx,float
wz,const char *
stl,float
d1,float
d2) - C function:
void
mgl_facez (HMGL
gr,float
x0,float
y0,float
z0,float
wx,float
wy,const char *
stl,float
d1,float
d2) 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 separately 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).
- Method on
mglGraph
(C++):void
Sphere (mglPoint
p,float
r,const char *
stl="r"
) - Method on
mglGraph
(Python):void
Sphere (float
x0,float
y0,float
z0,float
r,const char *
stl="r"
) - C function:
void
mgl_sphere (HMGL
gr,float
x0,float
y0,float
z0,float
r,const char *
stl) Draw the sphere with radius r and center at point p={x, y, z} and color stl.
- Method on
mglGraph
(C++):void
Drop (mglPoint
p,mglPoint
q,float
r,mglColor
col,float
shift=1
,float
ap=1
) - Method on
mglGraph
(C++):void
Drop (mglPoint
p,mglPoint
q,float
r,const char *
col="r",float
shift=1
,float
ap=1
) - Method on
mglGraph
(Python):void
Drop (float
x0,float
y0,float
z0,float
dx,float
dy,float
dz,float
r,const char *
col="r",float
shift=1
,float
ap=1
) - C function:
void
mgl_drop (HMGL
gr,float
x0,float
y0,float
z0,float
dx,float
dy,float
dz,float
r,const char *
col,float
shift,float
ap) Draw the drop with radius r at point p elongated in direction q and with color col. Parameter shift set the degree of drop oblongness: ‘0’ is sphere, ‘1’ is maximally oblongness drop. Parameter ap set relative width of the drop (this is analogue of “ellipticity” for the sphere). See section Drops sample, for sample code and picture.
- Method on
mglGraph
(C++):void
Cone (mglPoint
p1,mglPoint
p2,float
r1,float
r2=-1
,const char *
stl="B"
,bool
edge=false
) - Method on
mglGraph
(Python):void
Cone (float
x1,float
y1,float
z1,float
x2,float
y2,float
z2,float
r1,float
r2=-1
,const char *
stl="B"
,bool
edge=false
) - C function:
void
mgl_cone (HMGL
gr,float
x1,float
y1,float
z1,float
x2,float
y2,float
z2,float
r1,float
r2,const char *
stl,int
draw_edge) Draw tube (or truncated cone if edge=
false
) between points p1, p2 with radius at the edges r1, r2. If r2<0 then it is supposed that r2=r1. The cone color is defined by string stl.
- Method on
mglGraph
(C++):void
Mark (mglPoint
p,char
mark='.'
) - Method on
mglGraph
(Python):void
Mark (float
x,float
y,float
z,char
mark='.'
) - C function:
void
mgl_mark (HMGL
gr,float
x,float
y,float
z,char
mark) Draws a marks of different type at position p.
- Method on
mglGraph
(C++):void
Glyph (float
x,float
y,float
f,int
nt,const short *
trig,int
nl,const short *
line) Draw a set of triangles (or lines if trig=
NULL
) for glyph which is placed at point {x, y}. Values in the arrays are normalized by factor f. Normally this function is used internally.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |