tdotri(3NCARG)


NAME

   TDOTRI - Order the triangles defined by a triangle list.

SYNOPSIS

   CALL TDOTRI (RTRI, MTRI, NTRI, RTWK, ITWK, IORD)

C-BINDING SYNOPSIS

   #include <ncarg/ncargC.h>

   void c_tdotri(float *rtri, int mtri, int *ntri, float *rtwk, int *itwk,
   int iord)

DESCRIPTION

   This routine, given a list of NTRI triangles in the array RTRI and a
   real scratch array RTWK of length at least MTRI x 2 , determines the
   order in which the triangles are to be rendered and returns a
   permutation of the integers from 1 to NTRI in the array ITWK, defining
   that permutation.

   The caller may select any of three ways in which the triangles are to
   be ordered, the first two of which are essentially identical: When the
   argument IORD is given the value 0, the distances of the midpoints of
   the triangles from the viewpoint are computed and the triangles are
   sorted by decreasing order of these distances. When IORD is given the
   value -1, the result is the same, except that the distances of the
   farthest points of the triangles from the viewpoint are computed and
   the triangles are put in decreasing order of those distances. Both of
   these possibilities are appropriate for situations in which the
   triangles represent smooth surfaces that do not intersect each other or
   themselves; the occasional small errors in the resulting rendering
   order should be acceptable.

   If any of the triangles in the list intersect each other or if the
   surfaces being depicted are too rough, then the third option should be
   used: When IORD is given the value +1, TDOTRI executes an algorithm
   taken from the reference "Computer Graphics Principles and Practice",
   by Foley and Van Dam. It starts by ordering the triangles as if IORD
   had the value -1 (using distances of the far points of the triangles
   from the viewpoint), but then it checks for situations in which this
   ordering is in error and fixes the errors. Executing this algorithm can
   be time-consuming, so it should not be done unless it is really
   necessary; one possible way to proceed might be to use IORD = -1 while
   checking out a code and then use IORD = +1 only when doing final plots.

   Sometimes, when IORD = +1, triangles must be broken into smaller
   triangles, thereby increasing the total number of triangles in RTRI.
   If, as a result of this, NTRI becomes equal to MTRI, no error exit is
   taken; instead, TDOTRI just returns control to the caller. Therefore,
   it's a good idea, after calling TDOTRI, to check the value of NTRI
   against the dimension MTRI; if they're equal, it probably means that
   the triangle list filled up and that using the permutation returned in
   ITWK will result in an incorrect rendering of the triangles.

   The arguments of TDOTRI are as follows:

   RTRI    (an input/output array, of type REAL, dimensioned 10 x MTRI) -
           a list of triangles, probably created by means of calls to
           TDSTRI, TDITRI, and/or TDMTRI.  As described above, the number
           of triangles in the list may increase as a result of calling
           TDOTRI.

   MTRI    (an input expression of type INTEGER) - the second dimension of
           RTRI and thus the maximum number of triangles the triangle list
           will hold.

   NTRI    (an input/output variable of type INTEGER) - specifies the
           number of triangles currently in the list.  It is the user's
           responsibility to zero this initially; its value is increased
           by each call to a triangle-generating routine like TDSTRI or
           TDITRI and may be increased by a call to TDOTRI.

   RTWK    (a scratch array of type REAL, dimensioned at least MTRI x 2).

   ITWK    (an output array, of type INTEGER, dimensioned at least MTRI) -
           returned containing a permutation of the integers from 1 to
           NTRI, specifying the order in which the triangles ought to be
           rendered.

   IORD    (an input expression of type INTEGER) - says how the triangles
           are to be ordered.  The value 0 implies ordering by decreasing
           distance of the triangle midpoints from the eye, -1 implies
           ordering by decreasing distance of the triangle farpoints from
           the eye, and +1 implies ordering by decreasing distance of the
           triangle farpoints from the eye, with adjustments made by
           running an algorithm from the reference "Computer Graphics
           Principles and Practice", by Foley and Van Dam.

C-BINDING DESCRIPTION

   The C-binding argument descriptions are the same as the FORTRAN
   argument descriptions.

ACCESS

   To use TDOTRI or c_tdotri, load the NCAR Graphics libraries ncarg,
   ncarg_gks, and ncarg_c, preferably in that order.

SEE ALSO

   Online: tdclrs, tdctri, tddtri, tdgeti, tdgetr, tdgrds, tdgrid, tdgtrs,
   tdinit, tditri, tdlbla, tdlbls, tdline, tdlnpa, tdmtri, tdpack,
   tdpack_params, tdpara, tdplch, tdprpa, tdprpi, tdprpt, tdseti, tdsetr,
   tdsort, tdstri, tdstrs

COPYRIGHT

   Copyright (C) 1987-2009
   University Corporation for Atmospheric Research

   The use of this Software is governed by a License Agreement.





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.