Advanced form of TRIANGLE_P

07052014, 02:43 PM
Post: #1




Advanced form of TRIANGLE_P
Is anyone able to write a simple example of the use of advanced forms of TRIANGLE_P? I do not know how to draw a single triangle with the advanced form.
Software version (6030) 

07092014, 07:23 PM
Post: #2




RE: Advanced form of TRIANGLE_P
I don't know how TRIANGLE is used in every form, but here is the basic form of TRIANGLE:
TRIANGLE(x1, y1, x2, y2, x3, y3, color 1, color 2*, color 3*) If only color 1 is included, the triangle will be a solid color. If the 3 colors are included, we get a triangle of blended colors. The syntax is the same for both TRIANGLE and TRIANGLE_P. Eddie 

09152014, 03:26 AM
(This post was last modified: 09152014 03:22 PM by Han.)
Post: #3




RE: Advanced form of TRIANGLE_P
(07052014 02:43 PM)slawek39 Wrote: Is anyone able to write a simple example of the use of advanced forms of TRIANGLE_P? I do not know how to draw a single triangle with the advanced form. Edit: Caveat emptor  I have only tested one variation of the advanced form. You can see an example of it here: http://www.hpmuseum.org/forum/thread95.html Code: triangle_p( G0: can be replaced with G1 through G9 (these are the graphics buffers; G0 is the current display) pointdef: a list of point definitions. A point definition is either a list or a vector of the following form:
triangledef: a list of triangle definitions. A triangle definition is a list of three integers with optional fourth (color) and fifth (alpha) elements. The first three integers refer to the index of a point specified in pointdef.
RotMatrix is a rotation matrix whose dimension depends on whether you use 2D or 3D points (mainly useful for 3D with perspective projection). "N" specifies whether or not the points are normalized {xeye,yeye,zeye} is the eyepoint location if using 3D points. While the command does not complain about improper eyepoints, users should ensure that the eyepoint lies outside of the viewing box. Otherwise, the projection may appear skewed (or possibly inverted). {xmin3D,xmax3D,...,zmax3D} is a list specifying the corners of the viewbox. Any points outside of this viewbox is "clipped" and edges and faces are interpolated as appropriate. zclip is a string (usually generated by a simple zclip:=triangle() command with no arguments) is used for zclipping. 1. Don't combine alpha blending with zclipping. 2. There is currently some misbehavior with using triangle() and line() (and the _p variants thereof) without saving the output. These commands return a string that represents the point definitions in an internal format that can be used for later calls to triangle() and/or line(). This can be achieved by simply declaring a temporary local variable, say t, and using t:=triangle( ... arguments ... ); Han (Sorry for such a late response; just now catching up on older posts that I missed over the summer) Graph 3D  QPI  SolveSys 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)