TDDTRI(3NCARG)
π TDDTRI β bestie, it's triangle-drawing time π
okay so this is a page from the NCAR GRAPHICS manuals, section 3NCARG, and it's about a little routine called TDDTRI. she draws triangles. that's it. that's the whole vibe. β¨
β¨ NAME β¨
TDDTRI β draw the triangles defined by a triangle list. π
no literally that's her whole job description and she's iconic for it.
π¦ SYNOPSIS π¦
CALL TDDTRI (RTRI, MTRI, NTRI, ITWK)
πΈ C-BINDING SYNOPSIS πΈ
#include <ncarg/ncargC.h>
void c_tddtri(float *rtri, int mtri, int *ntri, int *itwk)
π DESCRIPTION π
so this routine draws the triangles defined by a triangle list. and the order she draws them in? that's dictated by whatever's sitting inside the permutation array ITWK. she's a girl who follows instructions. πββοΈ
how each individual triangle gets drawn depends on the rendering style you picked for it. generally speaking, first she fills it with a color you chose. but β if what you want is a wire-frame image and no lines are considered hidden, you can just skip that whole filling step, no biggie. the fill color can be:
- a specific one you picked yourself (ngl, sometimes picking the background color is genuinely the move π), or
- one selected from a range of colors you specified, chosen according to the angle between a line from the light source to the center of the triangle and the normal to the plane of the triangle β which is a fancy way of saying you get shading on the surface β¨
and after the triangle is filled? line segments representing its boundary and/or its intersection with planes of constant U, V, and/or W may be drawn in a user-specified contrasting color. layers, bestie. we love layers. π«Ά
the arguments of TDDTRI are as follows:
RTRIβ an input array, of typeREAL, dimensioned10 x MTRI. it's a list of triangles, probably created by means of calls toTDSTRI,TDITRI, and/orTDMTRI, and sorted, probably by means of a call toTDOTRI. π
if you're out here putting triangles in the triangle list directly (bold move, respect), keep the following in mind: for each value of i from 1 to NTRI,
RTRI(1,i),RTRI(2,i), andRTRI(3,i)are the U, V, and W coordinates of the first vertex of the triangle,RTRI(4,i),RTRI(5,i), andRTRI(6,i)are the U, V, and W coordinates of the second vertex of the triangle,RTRI(7,i),RTRI(8,i), andRTRI(9,i)are the U, V, and W coordinates of the third vertex of the triangle,- and
RTRI(10,i)=REAL(irst), whereirstis the index of the desired rendering style array for the triangle.
π¨ the order of the vertices is meaningful: they must be given in counter-clockwise order as viewed from the "top". do not freestyle this. she will know. π
also, it's better if all of the triangles in a triangle list are about the same size. just a little bestie-to-bestie tip. π
MTRIβ an input expression, of typeINTEGER. this is the second dimension ofRTRI, and thus the maximum number of triangles the triangle list will hold. it's giving capacity. πNTRIβ an input expression, of typeINTEGER. specifies the number of triangles currently in the list. so like, how many are actually here right now. πITWKβ an input array, of typeINTEGER, dimensioned at leastNTRI. contains a permutation of the integers from1toNTRI(probably generated by calling the routineTDOTRI). lowkey the chaos-ordering controller of the whole operation. π
π C-BINDING DESCRIPTION π
the C-binding argument descriptions are the same as the FORTRAN argument descriptions. same facts, different font, we stay consistent. π―
β ACCESS β
to use TDDTRI or c_tddtri, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β preferably in that order. the order matters, iykyk. π₯
π§ SEE ALSO π§
online: tdclrs, tdctri, tdgeti, tdgetr, tdgrds, tdgrid, tdgtrs, tdinit, tditri, tdlbla, tdlbls, tdline, tdlnpa, tdmtri, tdotri, tdpack, tdpack_params, tdpara, tdplch, tdprpa, tdprpi, tdprpt, tdseti, tdsetr, tdsort, tdstri, tdstrs
go read them all, bestie. the whole squad is here. π
π COPYRIGHT π
Copyright (C) 1987-2009 University Corporation for Atmospheric Research
the use of this Software is governed by a License Agreement.
okay and that's the whole page!! this was the NCAR GRAPHICS TDDTRI manual, a classic UNIX-page moment, dated July 1997, and yeah we're still quoting it today because she ate and left no crumbs. go draw some counter-clockwise triangles, bestie, and remember: same size, in order, no cap. π¦β¨ππ
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms