HP Prime Graphing Wireless Calculator User Manual

Page 286

Advertising
background image

282

Programming in HP PPL

The advanced form of LINE_P allows the multiple lines to
be rendered at the same time with a potential 3D
transformation of the triangle’s vertices.
This is mostly used if you have a set of vertices and lines
and want to display them all at once (faster).
points_definition is either a list or a matrix of point
definitions. Each point is defined by two to four numbers:
x, y, z, and color. A valid point definition can have
multiple forms. Here are some examples: [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.
line_ definitions is either a list or a matrix of line
definitions. Each line is defined by two to four numbers:
p1, p2, color and alpha. p1 and p2 are the index in the
points_definition of the two points that define the line.
Color is used to override the per point color definition. If
you need to provide an Alpha, but not a color, use -1 for
the color.
Note that {Color, [Alpha], line_1, ..., line_n} is also a valid
form to avoid respecifying the same color for each line.
rotation_matrix is a matrix between the sizes 2*2 to 3*4
that specifies the rotation and translation of the point using
usual 3D or 4D geometry.
{eye_x, eye_y, eye_z} defines the eye position
(projection).
{3Dxmin, 3Dxmax, 3Dymin, 3Dymax, 3Dzmin, 3Dzmax}
is used to perform 3D clipping on the pretransformed
objects.
Each point is rotated and translated through a
multiplication by the rotation_matrix. It is then projected
on the view plan using the eye position calculated by the
following equation: x=eye_z/z*x-eye_x and y=eye_z/
z*y-eye_y.
Each line is clipped in 3D, if 3D clipping data is provided.
If "N" is specified, the Z coordinates are normalized
between 0 and 255 after rotation, providing easier
zClipping.

Advertising