SET3(3NCARG)

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

✨ SET3 ✨ β€” NCAR GRAPHICS πŸ’–

okay bestie, gather round, because this one is literally the glow-up button for your 3-D graphics 🫢


NAME πŸŽ€

SET3 β€” bestie, it defines the transformation from three dimensions to two dimensions. that's it, that's the whole job, and it ATE. πŸ’…


SYNOPSIS 🌸

CALL SET3 (XMIN,XMAX,YMIN,YMAX,UMIN,UMAX,VMIN,VMAX,WMIN,WMAX,PEYE)

C-BINDING SYNOPSIS πŸ¦‹

#include <ncarg/ncargC.h>

void c_set3 (float xmin, float xmax, float ymin, float ymax,
float umin, float umax, float vmin, float vmax, float wmin,
float wmax, float peye[3])

DESCRIPTION πŸ’…

okay so let's break down every single one of these args, no skips, no shortcuts, we're doing the whole thing πŸ’–

  • XMIN,XMAX,YMIN,YMAX β€” these are input expressions of type REAL, and they're the fractional coordinates (in NDCs, iykyk) that define the portion of the plotter frame (the "viewport") that your 3-D objects get projected into. each one is a value between 0. and 1., inclusive β€” fr fr, no going outside that range. examples so you get the vibe: to use the whole plotter frame, set XMIN=0., XMAX=1., YMIN=0., and YMAX=1.; to use the upper left quarter of the plotter frame, set XMIN=0., XMAX=.5, YMIN=.5, and YMAX=1. ✨
  • UMIN,UMAX,VMIN,VMAX,WMIN,WMAX β€” also input expressions of type REAL, and these are the limiting coordinates, in a 3-D coordinate space that's totally the user's choice (main character energy, pick your own space), of the rectangular box that is to be projected. this box normally contains all of the objects whose projections are gonna be drawn. πŸ“¦
  • PEYE β€” this one's an input array, dimensioned 3, of type REAL, and it specifies the coordinates, in the user's 3-D coordinate system, of the eye position. the point
(PEYE(1),PEYE(2),PEYE(3))

must be outside the box defined by UMIN, UMAX, VMIN, VMAX, WMIN, and WMAX β€” like, outside outside, not touching. objects will be drawn as they appear from this point. πŸ‘οΈ

so the call to SET3 is saying three things at once: what portion of the 3-D coordinate system is to be projected, from what point it's to be projected, and where the resulting picture is to be placed on the plotter frame. iconic multitasking. πŸ’…

the array PEYE specifies the position of the eye, which may be referred to as the "viewpoint" or "center" of the projection. two names, one slay. ✨

the "line of sight" runs from the point

(PEYE(1),PEYE(2),PEYE(3))

(the eye position) to the point

(.5*(UMIN+UMAX),.5*(VMIN+VMAX),.5*(WMIN+WMAX))

(the point at the center of the projected box). 🌈

the "image plane" is perpendicular to the line of sight and may be thought of as passing through the center of the box. the projection of an arbitrary point P in 3-space is the point where the straight line from the eye position to P passes through the image plane. and the projection of a more complicated object? just the union of the projections of its constituent points. periodt. πŸ’–

the projection in the image plane of the box specified by the arguments UMIN, UMAX, VMIN, VMAX, WMIN, and WMAX will be scaled to fit in the viewport specified by the arguments XMIN, XMAX, YMIN, and YMAX. the projected box will retain its natural aspect ratio β€” and typically, it'll just touch the left and right edges of the viewport, or the top and bottom of the viewport, but not both. not me being picky about edges 😭

the image of the box will be rotated so that the projection of a unit vector based at the center of the box and pointing in the direction of the positive W axis will be made to point upward in the viewport. HOWEVER β€” and this is the plot twist β€” if the line of sight is very nearly parallel to the W axis, so that the projection of this unit vector shrinks almost to a point, then a unit vector based at the center of the box and pointing in the direction of the positive V axis will be made to point upward in the viewport instead. one implication of this is that, if you're making a movie by letting the eye "fly around" the objects being projected and it gets too close to being directly above or below the center of the box, there may be a sudden disconcerting rotation of the projected image. πŸ’€ like bestie, the camera does a little flip and you did NOT ask for it. be aware. πŸ™ˆ


C-BINDING DESCRIPTION 🧚

the C-binding argument descriptions are the same as the FORTRAN argument descriptions. literally identical, no notes. πŸ’œ


USAGE ⭐

SET3 should be called before calling other THREED routines. it goes first. it's the opener. the main event comes after. 🎀


EXAMPLES πŸ“

use the ncargex command to see the following relevant examples: tpwrzt, tthree. go look, they're cute, they eat. πŸ’–


ACCESS πŸ”₯

to use SET3 or c_set3, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. order matters bestie, don't fight it. πŸ‘‘


SEE ALSO 🌈

Online: threed, curve3, fence3, frst3, line3, perim3, point3, psym3, pwrz, pwrzt, threed, tick3, tick43, vect3, ncarg_cbind.

yes, threed is listed twice. no, i'm not removing it. the original said it twice and we respect the original in this house. πŸ’…

Hardcopy: NCAR Graphics Fundamentals, UNIX Version πŸ“š


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

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


okay that's the whole page bestie, you're officially SET3-pilled 🧚✨

this was SET3(3NCARG) from the NCAR GRAPHICS manual, and the version we just read was the one dated March 1993, tagged UNIX β€” vintage but still serving πŸ’–

πŸ“¦ where this page comes from