TDINIT(3NCARG)
π NAME π
okay so, bestie, this is TDINIT from the 3NCARG corner of the NCAR GRAPHICS manual, and it's the initialization routine for TDPACK β you call it to define where the eye is, where the eye is looking, which way is up, and whether or not you're doing a stereo view. π¦
β¨ SYNOPSIS β¨
CALL TDINIT (UMID, VMID, WMID, UORI, VORI, WORI, UTHI, VTHI, WTHI, OTEP)
π C-BINDING SYNOPSIS π
#include <ncarg/ncargC.h>
void c_tdinit(float umid, float vmid, float wmid, float uori, float
vori, float wori, float uthi, float vthi, float wthi, float otep)
πΈ DESCRIPTION πΈ
This init routine is the one you call to lay out the whole vibe of your 3D scene: where the eye is, where the point it's looking at is, which way is up, and whether or not a stereo view is happening. TDINIT precomputes some quantities in TDPACK common blocks that get used later to project points from 3-space (the U, V, and W coordinates) down into 2-space (the X and Y coordinates). no cap, that's the whole glow-up. β¨
By default β like, if the internal parameter 'SET' still has its default value β TDINIT also calls the SPPS routine SET to define the mapping from the "user" coordinate system (the X/Y system) to the "fractional" coordinate system (in GKS terms, NDC space). It does this in a way that shows a field of view of 'FOV' degrees in the projection plane. The viewport used in the fractional coordinate system is the one defined by the internal parameters 'VPL', 'VPR', 'VPB', and 'VPT'. And listen β in some situations it might be more of a serve to call TDINIT, then call the SPPS routine GETSET to retrieve the arguments that TDINIT used when it called SET, and then recall SET with a different set of arguments. slay, options. π
Normally, making an image with TDPACK starts with a call to TDINIT β maybe preceded by calls to TDSETI, TDSETR, and/or TDSTRS to reset internal parameters of the package β and then keeps going with calls to draw objects. (obvi, if every argument in a call to TDINIT has the same values as in the last call, and the SET call that happened as a result is still in effect, then you don't need to repeat the call to TDINIT. icon behaviour, honestly.)
For stereo views, the routine is: call TDINIT with a negative OTEP, execute the object-drawing calls, call TDINIT again with a positive OTEP, then repeat all of the object-drawing calls. The exact way stereo views get drawn is also affected (just a little bit) by the value of the internal parameter 'STE'. π
The arguments of TDINIT are as follows:
π UMID, VMID, and WMID
(input expressions of type REAL) β the coordinates of a point, E, at the eye position (if you're drawing a single view), or of a point midway between the two eyes (if you're drawing a stereo view).
π UORI, VORI, and WORI
(input expressions of type REAL) β the coordinates of a point, O, that the eye is looking at. That point defines the origin of the XY projection plane. The line of sight is the line from E to O. The projection plane passes through O and is perpendicular to the line of sight.
π UTHI, VTHI, and WTHI
(input expressions of type REAL) β the coordinates of a third point, T, needed to completely specify the orientation of the X and Y axes in the projection plane. The Y axis of the projection plane is its intersection with the plane passing though the points E, O, and T. The X axis of the projection plane passes through the point O and is perpendicular to the Y axis.
π OTEP
(an input expression of type REAL) β set non-zero if and only if a stereo view is to be drawn. Make the value negative to draw a left-eye view, positive to draw a right-eye view. The magnitude of OTEP is the distance from either eye to the point midway between the eyes; if R represents the approximate distance from the eye to the objects being drawn, then OTEP may be set using a statement like
OTEP = (+ or -) R *
TAN(.017453292519943*ANGD/2.)
where the constant (.01745...) is just pi/180 and ANGD is the desired difference in the angle between the two views, in degrees; use a value of about 1 or 2 degrees for ANGD.
Note that, if the origin is approximately in the middle of the objects being viewed, then it's probably appropriate to use a value of R computed as follows:
R = SQRT((UMID-UORI)**2
(VMID-VORI)**2+
(WMID-WORI)**2)
π«Ά C-BINDING DESCRIPTION π«Ά
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. same energy, different syntax, we love a bilingual king. π
β ACCESS β
To use TDINIT or c_tdinit, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. (in that order fr fr, don't freestyle it π)
π₯ SEE ALSO π₯
Online: tdclrs, tdctri, tddtri, tdgeti, tdgetr, tdgrds, tdgrid, tdgtrs, tditri, tdlbla, tdlbls, tdline, tdlnpa, tdmtri, tdotri, 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.
bestie, that's a real license agreement, not a vibe β respect it. π
and that's the whole page, TDINIT(3NCARG) π this one came out on a UNIX system in July 1997 β yeah she's vintage, she's a classic, she's mother, and she still ate. go project some points, queen. β¨ππ¦
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms