1gl_swtriangle(3)              Svgalib User Manual             gl_swtriangle(3)
2
3
4

NAME

6       gl_swtriangle - draw a solid pixmap mapped on a triangle
7
8

SYNOPSIS

10       #include <triangle.h>
11
12       typedef struct {
13           unsigned char *bitmap1;
14           unsigned char *bitmap2;
15           int bf;
16       } TD_tridata;
17
18       void  gl_swtriangle(int  x0, int y0, int xd0, int yd0 , int x1, int y1,
19       int xd1, int yd1 , int x2, int y2, int xd2, int yd2, int c,  TD_tridata
20       *tri);
21
22

DESCRIPTION

24       Draws  a  triangle  at points 0, 1, 2 by mapping the pixmaps defined in
25       the TD_triangle structure into the triangle.
26
27       The xd and yd values represent the triangle on the bitmap and the x and
28       y values represent the triangle on the screen.
29
30       bitmap1 defines the back side of the triangle, bitmap2 the front.
31
32       The  bf value is used to tell the routine to draw the backside if it is
33       facing the other way.  bf tells which way the triangle should be facing
34       to  show the front, since you will more than likely require both combi‐
35       nations.
36
37       bf = 2 defines the back to be drawn when the points are arranged clock‐
38       wise,  bf = 3 defines the back to be drawn when the points are arranged
39       counter clockwise, bf = -1 will probably always draw the front.
40
41       Beware, these functions are not a direct part of the  svgalib  library.
42       Instead their source is part of svgalib and can be found in the threeD‐
43       kit/ subdirectory of the original svgalib distribution. However, it  is
44       not  installed  in  the system by default, s.t. it is unclear where you
45       can find it if your svgalib was installed by some linux distribution.
46
47       In case of any such problem, simply get an  svgalib  distribution  from
48       the  net. Yo don't need to install it. Just make in the threeDkit/ sub‐
49       directory. As of this writing, svgalib-1.2.12.tar.gz is the latest ver‐
50       sion   and   can   be   retrieved   by   ftp  from  sunsite.unc.edu  at
51       /pub/Linux/libs/graphics and tsx-11.mit.edu at  /pub/linux/sources/libs
52       which will most probably be mirrored by a site close to you.
53
54       The  functions  are  defined in the tri.o and triangl.o files (or their
55       resp. sources) which you must link to your program.
56
57

SEE ALSO

59       vgagl(7), svgalib(7), threedkit(7),  gl_striangle(3),  gl_wtriangle(3),
60       gl_triangle(3),    gl_trigetcolorlookup(3),    gl_trisetcolorlookup(3),
61       gl_trisetdrawpoint(3), plane(6), wrapdemo(6).
62
63

AUTHOR

65       This manual page was edited  by  Michael  Weller  <eowmob@exp-math.uni-
66       essen.de>. The demos, the initial documentation and the whole threedkit
67       stuff was done by Paul Sheer <psheer@icon.co.za>.
68
69       Paper mail:
70              Paul Sheer
71              P O BOX 890507
72              Lyndhurst
73              Johannesburg 2106
74              South Africa
75
76       Donations (by check or postal  order)  will  be  appreciated  and  will
77       encourage  further  development  of  this  software.  However  this  is
78       strictly on a voluntary basis where this software falls under  the  GNU
79       LIBRARY GENERAL PUBLIC LICENSE.
80
81
82
83Svgalib (>= 1.2.11)               2 Aug 1997                  gl_swtriangle(3)
Impressum