HP Prime Graphing Wireless Calculator Manual do Utilizador Página 644

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
Vista de página 643
Syntax: LINE([G], x1, y1, x2, y2, [color])
Syntax: LINE([G],points_definition, lines_definitions, otation_matrix or
{rotation_matrix or -1, ["N"], [{eye_x, eye_y, eye_z} or -1], [{3Dxmin,
3Dxmax, 3Dymin, 3Dymax, 3Dzmin, 3Dzmax}]}, [zstring])
Syntax: LINE([G],pre_rotated_points, line_definitions, [zstring])
The basic form of LINE_P draws one line between specied pixel coordinates in the graphic using the specied
color.
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 denitions. Each point is dened by two to four
numbers: x, y, z, and color. A valid point denition 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 denitions. Each line is dened 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 dene the line. Color is used to override the per point color denition. 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 species the rotation and translation of
the point using usual 3D or 4D geometry.
{eye_x, eye_y, eye_z} denes 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 specied, the Z coordinates are normalized between 0 and 255 after rotation, providing easier
zClipping.
If zstring is provided, per pixel z clipping happens using the z value string (see the following).
LINE_P returns a string that contains all the transformed points. If you plan to call TRIANGLE or LINE
multiple times in a row using the same points and transformation, you can do so by replacing the
points_denition with this string and omitting the transformation denition in subsequent calls to TRIANGLE
and LINE.
About zstring:
TRIANGLE_P([G]) returns a string adapted for z clipping.
To use z clipping, call TRIANGLE_P to create a z clipping string (initialized at 255 for each pixels). You can
then call LINE_P with appropriate z (0-255) values for each of the triangle vertices and LINE_P will not draw
pixels farther than the already drawn pixels. ZString is automatically updated as appropriate.
596 Chapter 28 Programming in HP PPL
Vista de página 643
1 2 ... 639 640 641 642 643 644 645 646 647 648 649 ... 700 701

Comentários a estes Manuais

Sem comentários