Advanced form of TRIANGLE_P
|
09-15-2014, 03:26 AM
(This post was last modified: 09-15-2014 03:22 PM by Han.)
Post: #3
|
|||
|
|||
RE: Advanced form of TRIANGLE_P
(07-05-2014 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/thread-95.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 z-clipping. 1. Don't combine alpha blending with z-clipping. 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 »
|
Messages In This Thread |
Advanced form of TRIANGLE_P - slawek39 - 07-05-2014, 02:43 PM
RE: Advanced form of TRIANGLE_P - Eddie W. Shore - 07-09-2014, 07:23 PM
RE: Advanced form of TRIANGLE_P - Han - 09-15-2014 03:26 AM
|
User(s) browsing this thread: 1 Guest(s)