1gl_wtriangle(3) Svgalib User Manual gl_wtriangle(3)
2
3
4
6 gl_wtriangle - draw a shadowed pixmap mapped on a triangle
7
8
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_wtriangle(int x0, int y0, int xd0, int yd0, int z0 , int x1,
19 int y1, int xd1, int yd1, int z1 , int x2, int y2, int xd2, int yd2,
20 int z2, TD_tridata *tri);
21
22
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. The z values represent
29 an additional value which will be added to the color that is looked up
30 from the pixmap data. Once again, if the current context is more than 8
31 bits then the result is interpreted as an index to the same lookup ta‐
32 ble. See gl_triangle(3) for more details on shadowing.
33
34 gl_wtriangle is used to draw wrapped surfaces with shadowing interpola‐
35 tion. The function gl_swtriangle(3) does it without shadowing.
36
37 bitmap1 defines the back side of the triangle, bitmap2 the front.
38
39 The bf value is used to tell the routine to draw the backside if it is
40 facing the other way. bf tells which way the triangle should be facing
41 to show the front, since you will more than likely require both combi‐
42 nations.
43
44 bf = 2 defines the back to be drawn when the points are arranged clock‐
45 wise, bf = 3 defines the back to be drawn when the points are arranged
46 counter clockwise, bf = -1 will probably always draw the front.
47
48 Beware, these functions are not a direct part of the svgalib library.
49 Instead their source is part of svgalib and can be found in the threeD‐
50 kit/ subdirectory of the original svgalib distribution. However, it is
51 not installed in the system by default, s.t. it is unclear where you
52 can find it if your svgalib was installed by some linux distribution.
53
54 In case of any such problem, simply get an svgalib distribution from
55 the net. Yo don't need to install it. Just make in the threeDkit/ sub‐
56 directory. As of this writing, svgalib-1.2.12.tar.gz is the latest ver‐
57 sion and can be retrieved by ftp from sunsite.unc.edu at
58 /pub/Linux/libs/graphics and tsx-11.mit.edu at /pub/linux/sources/libs
59 which will most probably be mirrored by a site close to you.
60
61 The functions are defined in the tri.o and triangl.o files (or their
62 resp. sources) which you must link to your program.
63
64
66 vgagl(7), svgalib(7), threedkit(7), gl_striangle(3), gl_swtriangle(3),
67 gl_triangle(3), gl_trigetcolorlookup(3), gl_trisetcolorlookup(3),
68 gl_trisetdrawpoint(3), plane(6), wrapdemo(6).
69
70
72 This manual page was edited by Michael Weller <eowmob@exp-math.uni-
73 essen.de>. The demos, the initial documentation and the whole threedkit
74 stuff was done by Paul Sheer <psheer@icon.co.za>.
75
76 Paper mail:
77 Paul Sheer
78 P O BOX 890507
79 Lyndhurst
80 Johannesburg 2106
81 South Africa
82
83 Donations (by check or postal order) will be appreciated and will
84 encourage further development of this software. However this is
85 strictly on a voluntary basis where this software falls under the GNU
86 LIBRARY GENERAL PUBLIC LICENSE.
87
88
89
90Svgalib (>= 1.2.11) 2 Aug 1997 gl_wtriangle(3)