TDDTRI(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– 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 type REAL, dimensioned 10 x MTRI. it's a list of triangles, probably created by means of calls to TDSTRI, TDITRI, and/or TDMTRI, and sorted, probably by means of a call to TDOTRI. πŸ’–

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), and RTRI(3,i) are the U, V, and W coordinates of the first vertex of the triangle,
  • RTRI(4,i), RTRI(5,i), and RTRI(6,i) are the U, V, and W coordinates of the second vertex of the triangle,
  • RTRI(7,i), RTRI(8,i), and RTRI(9,i) are the U, V, and W coordinates of the third vertex of the triangle,
  • and RTRI(10,i)=REAL(irst), where irst is 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 type INTEGER. this is the second dimension of RTRI, and thus the maximum number of triangles the triangle list will hold. it's giving capacity. πŸ‘‘
  • NTRI β€” an input expression, of type INTEGER. specifies the number of triangles currently in the list. so like, how many are actually here right now. πŸŽ€
  • ITWK β€” an input array, of type INTEGER, dimensioned at least NTRI. contains a permutation of the integers from 1 to NTRI (probably generated by calling the routine TDOTRI). 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 (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