| [ < ] | [ > ] | [ << ] | [ 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):voidClf (mglColorBack=WC) - C function:
voidmgl_clf (HMGLgr) - C function:
voidmgl_clf_rgb (HMGLgr,floatr,floatg,floatb) Clear the picture and fill it by color Back.
- Method on
mglGraph(C++):voidBall (floatx,floaty,floatz,mglColorcol=RC,floatalpha=1) - Method on
mglGraph(C++):voidBall (mglPointp,charcol='r') - Method on
mglGraph(Python):voidBall (floatx,floaty,floatz,charcol='r') - C function:
voidmgl_ball (HMGLgr,floatx,floaty,floatz) - C function:
voidmgl_ball_rgb (HMGLgr,floatx,floaty,floatz,floatr,floatg,floatb,floatalpha) - C function:
voidmgl_ball_str (HMGLgr,floatx,floaty,floatz,charcol) Draws a point (ball) at position p={x, y, z} with color col.
- Method on
mglGraph(C++):voidError (mglPointp,mglPointe,char*pen="") Draws a 3d error box at position p with sizes e and style pen.
- Method on
mglGraph(C++):voidLine (mglPointp1,mglPointp2,char *stl="B",intnum=2) - Method on
mglGraph(Python):voidLine (floatx1,floaty1,floatz1,floatx2,floaty2,floatz2,char *stl="B",intnum=2) - C function:
voidmgl_line (HMGLgr,floatx1,floaty1,floatz1,floatx2,floaty2,floatz2,char *stl,intnum) 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=
2then 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++):voidCurve (mglPointp1,mglPointd1,mglPointp2,mglPointd2,const char *stl="B",intnum=100) - Method on
mglGraph(Python):voidCurve (floatx1,floaty1,floatz1,floatdx1,floatdy1,floatdz1,floatx2,floaty2,floatz2,floatdx2,floatdy2,floatdz2,const char *stl="B",intnum=100) - C function:
voidmgl_curve (HMGLgr,floatx1,floaty1,floatz1,floatdx1,floatdy1,floatdz1,floatx2,floaty2,floatz2,floatdx2,floatdy2,floatdz2,const char *stl,intnum) 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=
2then 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++):voidFace (mglPointp1,mglPointp2,mglPointp3,mglPointp4,const char *stl="w",intnum=2,floatval=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):voidFaceX (floatx0,floaty0,floatz0,floatwy,floatwz,const char *stl="w",floatdx=0,floatdy=0) - Method on
mglGraph(C++, Python):voidFaceY (floatx0,floaty0,floatz0,floatwx,floatwz,const char *stl="w",floatdx=0,floatdy=0) - Method on
mglGraph(C++, Python):voidFaceZ (floatx0,floaty0,floatz0,floatwx,floatwy,const char *stl="w",floatdx=0,floatdy=0) - C function:
voidmgl_facex (HMGLgr,floatx0,floaty0,floatz0,floatwy,floatwz,const char *stl,floatd1,floatd2) - C function:
voidmgl_facey (HMGLgr,floatx0,floaty0,floatz0,floatwx,floatwz,const char *stl,floatd1,floatd2) - C function:
voidmgl_facez (HMGLgr,floatx0,floaty0,floatz0,floatwx,floatwy,const char *stl,floatd1,floatd2) 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++):voidSphere (mglPointp,floatr,const char *stl="r") - Method on
mglGraph(Python):voidSphere (floatx0,floaty0,floatz0,floatr,const char *stl="r") - C function:
voidmgl_sphere (HMGLgr,floatx0,floaty0,floatz0,floatr,const char *stl) Draw the sphere with radius r and center at point p={x, y, z} and color stl.
- Method on
mglGraph(C++):voidDrop (mglPointp,mglPointq,floatr,mglColorcol,floatshift=1,floatap=1) - Method on
mglGraph(C++):voidDrop (mglPointp,mglPointq,floatr,const char *col="r",floatshift=1,floatap=1) - Method on
mglGraph(Python):voidDrop (floatx0,floaty0,floatz0,floatdx,floatdy,floatdz,floatr,const char *col="r",floatshift=1,floatap=1) - C function:
voidmgl_drop (HMGLgr,floatx0,floaty0,floatz0,floatdx,floatdy,floatdz,floatr,const char *col,floatshift,floatap) 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++):voidCone (mglPointp1,mglPointp2,floatr1,floatr2=-1,const char *stl="B",booledge=false) - Method on
mglGraph(Python):voidCone (floatx1,floaty1,floatz1,floatx2,floaty2,floatz2,floatr1,floatr2=-1,const char *stl="B",booledge=false) - C function:
voidmgl_cone (HMGLgr,floatx1,floaty1,floatz1,floatx2,floaty2,floatz2,floatr1,floatr2,const char *stl,intdraw_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++):voidMark (mglPointp,charmark='.') - Method on
mglGraph(Python):voidMark (floatx,floaty,floatz,charmark='.') - C function:
voidmgl_mark (HMGLgr,floatx,floaty,floatz,charmark) Draws a marks of different type at position p.
- Method on
mglGraph(C++):voidGlyph (floatx,floaty,floatf,intnt,const short *trig,intnl,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] | [ ? ] |
