manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.7 Primitives drawing

These functions draw some simple objects like line, point, sphere, drop, cone and so on.

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 will it by color {r,g,b} or previous one.

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, const char * col)

Draws a point (ball) at position {x, y, z} with color defined by string col or by RGBA values {r, g, b; alpha}. Default color is red.

C function: void mgl_line (HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, char *stl, intnum)

Draws a geodesic line (straight line in Cartesian coordinates) from point {x1,y1,z1} to {x2,y2,z2} using line style stl. Parameter num define the “quality” of the line. If num=2 then the straight line will be drawn in all coordinate system (independently on transformation formulas (see section Transformation (curved coordinates, Pure C)). 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).

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 {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. Parameter num define the number of points for the curve.

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 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).

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 {x0, y0, z0} and color stl.

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 {x0,y0,z0} elongated in direction {dx,dy,dz} 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.

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 {x1,y1,z1}, {x2,y2,z2} with radius at the edges r1, r2. If r2<0 then it is suppsosed that r2=r1. The cone color is defined by string stl.

C function: void mgl_mark (HMGL gr, float x, float y, float z, char mark)

Draws a marks of different type at position {x,y,z}.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2026
Individual documents may contain additional copyright information.