
END;
The program executes until the user presses to terminate.
TRIANGLE_P, TRIANGLE
Syntax: TRIANGLE_P([G], x1, y1, x2, y2, x3, y3, c1, [c2, c3], [Alpha],
["ZString", z1, z2, z3])
Syntax: TRIANGLE_P([G], {x1, y1, [c1], [z1]}, {x2, y2, [c2], [z2]},{x3, y3,
[c3], [z3]}, ["ZString"])
Syntax: TRIANGLE_P([G],points_definition, triangle_definitions,
rotation_matrix or {rotation_matrix or -1, ["N"], [{eye_x, eye_y, eye_z}
or -1], [{3Dxmin, 3Dxmax, 3Dymin, 3Dymax, 3Dzmin, 3Dzmax}]}, [zstring])
Syntax: TRIANGLE_P([G],pre_rotated_points, triangle_definitions, [zstring])
Syntax: TRIANGLE_P([G])
The basic form of TRIANGLE draws one triangle between the specied pixel coordinates in the graphic using
the
specied color and transparency (0 ≤ Alpha ≤ 255). If three colors are specied, it blends the colors in
between the vertices.
The advanced form of TRIANGLE_P allows multiple triangles to be rendered at the same time with a
potential 3D transformation of the triangles’ vertices.
This is mostly used if you have a set of vertices and triangles and want to display them all at once (faster).
points_definition is either a list or a matrix of point denition. Each point is dened by two to four
numbers: x, y, z, and color. A valid point denition can have multiple forms. Here are a couple of example: [x,
y, z, c], {x, y, z, c}, {x, y, #c}, {(x, y), c}, (x,y)... You can use a vector of points instead of a list; in this case, the
points can be expressed as complex numbers.
triangle_ definitions is either a list or a matrix of triangle denitions. Each triangle is dened by
three to ve numbers: p1, p2, p3, color and alpha. p1, p2 and p3 are the index in the points_definition
of the 3 points that dene the triangle. Color is used to override the per point color denition. If you need to
provide an Alpha, but not a color, use -1 for the color.
Note that {Color, [Alpha], triangle_1, ..., triangle_n} is also a valid form to avoid
respecifying the same color for each triangle.
600 Chapter 28 Programming in HP PPL
Komentarze do niniejszej Instrukcji