NAME

plot3d_unit -- unit for 3d plots

PROTOTYPE

unitptr plot3d_unit( char *pcWinDescr, char *pcFmt, unitptr uHost)

ARGUMENTS

char *pcWinDescr
window descriptor: title xll yll dx dy
char *pcFmt
options
unitptr uHost
host unit

RETURN VALUE:

A pointer to the created unit or NULL in the case of an error.

INTERFACE OF CREATED UNIT:

X_in[3]:
center in data coord of viewed volume (defaults: 0,0,0)
Y_in[3]:
size in data coord of viewed volume (defaults: 1,1,1)
Z_in[3]:
viewer location in normalized coord (defaults: 0,-2,0)
in_3[3]:
size of display cube in normalized coord (defaults: 1,1,1)
in_4[3]:
xsteps,tx,dtx tick mark specs for x-axis
in_5[3]:
ysteps,ty,dty tick mark specs for y-axis
in_6[3]:
zsteps,tz,dtz tick mark specs for z-axis
in_7[1]:
color of frame (if displayed)
CTL_in[3]:
focus (in normalized coord) and vertical and horizontal rotation angle for viewing direction

EXECUTION OF CREATED UNIT:

Sets up a 3d perspective projection. In addition, if pcFmt contains %F, a coordinate frame is displayed. The display is cleared and the coordinate frame redisplayed whenever one of the viewing parameters has changed. Any further 3d drawing must be done by draw_sym (using 3D-mode) and draw_mesh units that use the window of the present unit as their window host. These units will then recognize the proper scaling and put markers or mesh points at the proper 3D positions. Note: currently, only the draw_sym and the draw_mesh units will cooperate with the plot3d unit. The draw_str and draw_pix units won't recognize any 3d scaling. Much of the plot3d unit is similar to the view3d unit. However, unlike the view3d unit, the plot3d unit needs no GL or OpenGl support and is already available with plain X11 graphics. A further difference is that it is not an operator unit (as the view3d unit is), and it has no built-in mouse support. However, such feature can be added by the user, using the CTL_in[] field to rotate the view direction.

NOTE:

Execution of the plot3d unit does not include a clear of the drawing units that draw into it. If a clear between successive views is required, you must use an instance of the clear_window unit to achieve this. This instance should be placed after the plot3d unit itself to avoid unnecessary clears of the coordinate frame. Clearing can be avoided by using the %I (inverse undraw) mode for this unit and its drawing units.

CONTROL MODES:

OPTIONS:

%f:gC
redefine foreground to color f, background to color g, (here, 0 and 1 always have the meanings of black and white)
%fC
redefine foreground to color f. %0C additionally chooses white background, i.e., yields black on white.
%C
redefine background (foreground) color to NST window (text) color
%H
creates the unit with the window closed
%F
show coordinate frame
%I
use inverse drawing mode (to be used together with draw units that are in %I mode)

EXAMPLES:

Plot3dKohonenDemo illustrates how to add interactive rotation and zoom to the plot3d unit.

STATUS:

Preliminary.

SEE ALSO:

view3d, draw_mesh, draw_sym, clear_window

FILE

/local/homes/rhaschke/nst7/man/../o.linx86//../nstsrc/nst_plot.c