Chapter 20: Drawing surfaces and isosurfaces

Previous chapter          LLUs Home          Next chapter          Index
Three-dimensional plots can be drawn using the Surface and Isosurface utilities.

The SRFACE routine draws a perspective picture of a surface represented by a two-dimensional input array. Each value in the array represents the height for a point in the surface.

The ISOSRF routine also draws a perspective picture of a surface; however, it computes the surface from a 3-D "volume" of data and a threshold value defining the surface.

This module discusses how to draw 3-D images and add perspective text to a plot.

Table of isosurface-drawing user entry points

There are two sets of routines for drawing 3-D images. This table lists the routines in each set: the Isosurface routines and the Surface routines.

Isosurface routines

EZISOS
Simpler alternative for drawing an isosurface than using the ISOSRF routine.

ISGETI
Gets isosurface integer parameters.

ISGETR
Gets isosurface real parameters.

ISOSRF
Draws an isosurface.

ISSETI
Sets the isosurface integer parameters.

ISSETR
Sets the isosurface real parameters.

PWRZI
Plots characters in 3-space when using ISOSRF.

Surface routines

EZSRFC
Simpler alternative for drawing a surface than using the SRFACE routine.

PWRZS
Plots characters in 3-space when using the SRFACE routine.

SRFACE
Draws a surface.

SETR
Overlays THREED and SRFACE plots. See the fthex05.f code segment in the THREED module for an example that uses this routine. (The SETR routine has not been previously documented.)

Table of Isosurface-drawing parameters

For a complete description of the Isosurface parameters, see the isosurface_params man page or the Isosurface programmer document.

Isosurface parameters

-------------------------------------------------------------
Parameter  Brief description                     Fortran type  
-------------------------------------------------------------
IU         Number of U-axis Interpolation slabs  Integer       
IV         Number of V-axis Interpolation slabs  Integer       
IW         Number of W-axis Interpolation slabs  Integer       
RF         ReFerence plane drawing flag          Integer       
RS         Relative Size flag                    Real          
SL         Smooth curve segment Length           Real          
SM         Screen Model resolution               Integer       
ST         Spline Tension                        Real          
SV         Special Value flag                    Integer       
VB         Viewport Bottom edge                  Real          
VL         Viewport Left edge                    Real          
VR         Viewport Right edge                   Real          
VT         Viewport Top edge                     Real          
-------------------------------------------------------------

Table of surface-drawing parameters

The Surface parameters are not accessible via parameter retrieving and setting routines at this time. We hope to update the Surface utility and include new functionality as well as parameter-access routines. Currently, however, internal Surface parameters are only accessible in common blocks. Please see the Surface man page for more information about specific routines.

Surface internal parameters

-----------------------------------------------------------
Parameter  Brief description                   Fortran type  
-----------------------------------------------------------
IFR        Flag for calling FRame              Integer       
ISTP       Stereo flag                         Integer       
IROTS      Controls plotting direction         Integer       
IDRX       DRaw lines of constant X flag       Integer       
IDRY       DRaw lines of constant Y flag       Integer       
IDRZ       DRaw lines of constant Z flag       Integer       
IUPPER     Draw UPPER/lower/both side flag     Integer       
ISKIRT     Draw SKIRT around surface flag      Integer       
NCLA       Number of Z levels (approximation)  Integer       
THETA      Stereo angle in radians             Real          
HSKIRT     Height of SKIRT                     Real          
CHI        HIghest level of Constant Z         Real          
CLO        LOwest level of Constant Z          Real          
CINC       INCrement between levels            Real          
IOFFP      Special value flag                  Integer       
SPVAL      The SPecial VALue                   Real          
-----------------------------------------------------------

Isosurface parameters: What they do and how to use them

The Isosurface parameters control characteristics such as position, missing data value, interpolation factors, and so on. This module explains how to set and retrieve these Isosurface parameters with parameter-access routines. The internal Surface parameters, however, must be accessed via common blocks.

Synopsis

      CALL ISGETI (PNAM, IVAL)
      CALL ISGETR (PNAM, RVAL)
      CALL ISSETI (PNAM, IVAL)
      CALL ISSETR (PNAM, RVAL)

Routines

ISGETI, ISGETR
The ISGETI and ISGETR routines are used to retrieve the current value of the parameter, PNAM. The value is returned in the second argument.

ISGETI is used to retrieve integer parameters. ISGETR is used to retrieve real parameters.

ISSETI, ISSETR
The ISSETI and ISSETR routines are used to assign a value (the second argument) to the parameter, PNAM.

ISSETI is used to set integer parameters.ISSETR is used to set real parameters.

Arguments

PNAM
Character, Input---A two-letter string that specifies the name of a parameter. This is one of the two-character mnemonics listed in the parameter table under "Isosurface parameters." Only the first two characters of PNAM are relevant, and they should be uppercase. A longer character string may be used to more clearly document what parameter is being accessed.

IVAL
Integer, Input or Output---An integer value.

RVAL
Real, Input or Output---A real value.

Discussion

The Isosurface parameters are controlled using the ISGETx and ISSETx parameter-access routines.

The internal Surface parameters, however, cannot currently be accessed with these types of routines. We hope to add this functionality in the future. Until then, Surface parameters must be accessed via common blocks.

Drawing pictures with the EZISOS routine

If the following three conditions are met, then you can use EZISOS to draw an isosurface. The conditions are when the entire range of the input array is used, when it doesn't matter which constant lines of U, V, and W are used to draw the surface, and when a frame advance is to be done after drawing the surface. If these three conditions are not met, then you must use ISOSRF. This module demonstrates how to use EZISOS.

EZISOS plot

Code segment from fisissrf.f

1       DIMENSION       T(21,31,19),SLAB(33,33),EYE(3)
2       DATA NU,NV,NW/21,31,19/
3       DATA TISO/0./
4
5       EYE(1) = 100.
6       EYE(2) = 150.
7       EYE(3) = 125.
8       CALL GSELNT(0)
9       CALL EZISOS (T,NU,NV,NW,EYE,SLAB,TISO)
10      RETURN

Synopsis

      CALL EZISOS (FINPUT, MU, MV, MW, EYE, SLAB, FISO)

Arguments

FINPUT
Real array, Input---A 3-D array of data defining the "volume" of data through which the isosurface, defined by FISO, passes. The entire array is used and cannot be subsampled, unlike when using the ISOSRF routine. The dimensions of FINPUT are MU * MV * MW.

MU, MV, MW
Integer, Input---The first, second and third dimensions of FINPUT, respectively.

EYE
Real array, Input---A three-element array that defines the eye position in the UVW coordinate system. The eye position at (EYE(1), EYE(2), EYE(3)) must be outside the bounds of the box containing the data. The eye looks from the eye position to the center of the data box, and the projection plane is perpendicular to the line of sight. A good initial choice for EYE is:
(5. * REAL(MU), 3.5 * REAL(MV), 2. * REAL(MW))

SLAB
Real array, Workspace---A workspace array dimensioned at least n by n, where n is defined to be the maximum of (MU, MV, MW) + 2.

FISO
Real, Input---The value that defines the isosurface. The isosurface passes through the data values in FINPUT that equal FISO.

Discussion

EZISOS should only be used to draw an isosurface if the following three conditions are met: if all of FINPUT is used, if it doesn't matter which constant lines of U, V, and W are used to draw the surface, and if a frame advance is to be done after the surface is drawn. If these conditions are not met, then use the ISOSRF routine described in the next module.

The fisissrf.f code segment demonstrates how to use EZISOS to draw a perspective picture of an isosurface.

Line 1 sets up the dimensions of the input array, workspace array, and eye point. Because of space constraints, the code for filling the input array, T, with a "volume" of data is not shown. Please see the fisissrf.f file for this code.

Line 2 initializes the integer variables that define the input array dimensions.

Line 3 sets the threshold value that defines the isosurface. The isosurface will pass through all data points in the input array, T, that equal this value.

Lines 5 through 7 define the position of the eye.

Line 8 selects the identity transformation in which both the window and viewport have the range of 0. to 1. in both dimensions.

Line 9 calls EZISOS to draw the isosurface.

Line 10 returns from the function call. Note that when using EZISOS, you do not need to advance the frame with the FRAME call.

Drawing pictures with the ISOSRF routine

ISOSRF is a more general-purpose isosurface-drawing routine than EZISOS. Unlike EZISOS, it does not have any predefined conditions that must be met, and ISOSRF supports data subsampling. This module demonstrates how to draw an isosurface with the ISOSRF routine.

ISOSRF plot

Code segment from fisissrf.f

1       DIMENSION       T(21,31,19),SLAB(33,33),EYE(3)
2       DATA NU,NV,NW/21,31,19/
3       DATA TISO/0./
4       DATA IFLAG/-7/
5       EYE(1) = 100.
6       EYE(2) = 150.
7       EYE(3) = 125.
8       CALL GSELNT(0)
9       MU=NU/2
10      MV=NV/2
11      MW=NW/2
12      MUVWP2=MAX0(MU,MV,MW)+2
13      CALL ISOSRF(T(MU,MV,MW),NU,MU,NV,MV,MW,EYE,MUVWP2,SLAB,TISO,IFLAG)
14      CALL FRAME

Synopsis

      CALL ISOSRF (FINPUT, LU, MU, LV, MV, MW, EYE, MUVWP2, SLAB, FISO,
     +             IFLAG)

Arguments

FINPUT
Real array, Input---A 3-D array of data defining the "volume" through which the isosurface, defined by FISO, passes. The dimensions of FINPUT are LU by LV by m, where m is greater than or equal to MW. Unlike the EZISOS routine, ISOSRF allows you to create an isosurface from a subarray, defined by MU, MV, and MW, of FINPUT.

LU, LV
Integer, Input---Defines the first and second dimensions of the FINPUT array, respectively.

MU, MV, MW
Integer, Input---Defines the range to be used for the first, second and third subscript of the FINPUT array, respectively. Only the portion of the array consisting of elements FINPUT(IU,IV,IW), for IU = 1 to MU, IV = 1 to MV, and IW = I to MW, is used. This may or may not be the entire array.

EYE
Real array, Input---A three-element array that defines the eye position in the UVW coordinate system. They eye position at (EYE(1), EYE(2), EYE(3)) must be outside the bounds of the box containing the data. The eye looks from the eye position to the center of the data box, and the projection plane is perpendicular to the line of sight. A good initial choice for EYE is:
(5. * REAL(MU), 3.5 * REAL(MV), 2.*REAL(MW))

MUVWP2
Integer, Input---The integer value that is the maximum of (MU, MV, and MW) plus 2.

SLAB
Real array, Workspace---A workspace array dimensioned at least MUVWP2 * MUVWP2.

FISO
Real, Input---The value that defines the isosurface. The isosurface passes through the data values in FINPUT that equal FISO.

IFLAG
Integer, Input---IFLAG serves two purposes:

First, the absolute value of IFLAG determines which type of lines (lines of constant U, V, and W) are drawn to approximate the isosurface. The following table lists the types of lines drawn based on the absolute value of IFLAG.
-----------------------------------------
       Lines of    Lines of    Lines of    
IFLAG  Constant U  Constant V  Constant W  
   1   no          no          yes         
   2   no          yes         no          
   3   no          yes         yes         
   4   yes         no          no          
   5   yes         no          yes         
   6   yes         yes         no          
   7   yes         yes         yes         
-----------------------------------------

Second, the sign of IFLAG determines what is inside and what is outside the solid bounded by the isosurface and thus which lines are visible and what is done at the boundary of the box containing the data. If IFLAG is positive, values greater than FISO are considered to be inside the solid formed by the isosurface. If IFLAG is negative, values less than FISO are considered to be inside the isosurface. If ISOSRF draws a cube, reverse the sign of IFLAG.

Discussion

ISOSRF allows you to draw a perspective view of an isosurface. Contours created by taking slices in any of three directions through the isosurface are drawn with hidden portions of the contour lines removed.

Line 1 of the fisissrf.f code segment sets up the dimensions of the input array, workspace array, and eye point array. Because of space constraints, the code for filling the input array, T, with a "volume" of data is not shown. Please see the fisissrf.f file for this code.

Line 2 initializes the integer variables that define the input array dimensions.

Line 3 sets the threshold value that defines the isosurface. The isosurface passes through all data points in the input array, T, that equal this value.

Line 4 sets IFLAG to -7. This indicates to the ISOSRF routine to draw lines of constant U, V, and W, and that values less than FISO should be considered inside the isosurface solid.

Lines 5 through 7 define the eye position.

Line 8 selects the identity transformation in which both the window and viewport have the range of 0. to 1. in both dimensions.

Lines 9 through 11 set the subarray size.

Line 12 calculates the maximum of (MU, MV, and MW) plus 2.

Line 13 draws the isosurface.

Line 14 advances the frame. FRAME must be called explicitly with the ISOSRF routine. (You do not need to call FRAME when using EZISOS.)

Drawing text in 3-space when using ISOSRF

PWRZI is a character-plotting routine used to draw characters in 3-space when using the ISOSRF routine. The PWRZI routine lets you position text at any position and orientation in the plot.

This module demonstrates how to use PWRZI to draw text when using the ISOSRF routine and how to set the surface and text colors.

Drawing text with the PWRZI routine

Code segment from fispwrzi.f

1       CALL GSPLCI(4)
2       CALL ISOSRF (T(MU,MV,MW),NU,MU,NV,MV,MW,EYE,MUVWP2,SLAB,TISO,
3      + IFLAG)
4       ISIZE = 35
5       CALL GSPLCI(2)
6       CALL PWRZI (5.,16.,.5,'FRONT',5,ISIZE,-1,3,0)
7       CALL PWRZI (11.,7.5,.5,'SIDE',4,ISIZE,2,-1,0)
8       CALL PWRZI (5.,1.,5.,' BACK BACK BACK BACK BACK',25,ISIZE,-1,3,0)
9       CALL FRAME

Synopsis

      CALL PWRZI (X, Y, Z, LABEL, N, ISIZE, LINE, ITOP, ICNT)
X, Y, Z
Real, Input---The positioning coordinates for the characters to be drawn. These are floating point numbers in the same 3-space coordinate system used in ISOSRF.

LABEL
Character, Input---Specifies the character string to be drawn. PWRZI only draws uppercase characters, so LABEL must be a string of all uppercase characters.

N
Integer, Input---Specifies the number of characters in LABEL.

ISIZE
Integer, Input---Specifies the size of characters to be used.

If ISIZE is between 0 and 3, the value specifies 1., 1.5, 2., or 3. times a standard width equal to 1/128th of the screen width.

If ISIZE is greater than 3, the value specifies a character width in plotter address units (by default, 1 plotter address unit is 1/1024th of the screen width).

LINE
Integer, Input---Specifies the coordinate direction in which the characters are written.

+1
Draws text in the +X direction.
-1
Draws text in the -X direction.
+2
Draws text in the +Y direction.
-2
Draws text in the -Y direction.
+3
Draws text in the +Z direction.
-3
Draws text in the -Z direction.

ITOP
Integer, Input---Specifies the coordinate direction from the center of the first character to the top of the first character. Valid values for ITOP are the same as those for LINE, given above. Note that the absolute value of LINE cannot equal the absolute value of ITOP.

ICNT
Integer, Input---Specifies the centering option.

-1
(X,Y,Z) is the center of the left edge of the first character.
0
(X,Y,Z) is the center of the entire string.
+1
(X,Y,Z) is the center of the right edge of the last character.

Discussion

PWRZI is a limited text-drawing routine for labeling isosurfaces in 3-space. There is only one font, and lowercase characters will not be printed. Character color is controlled by calling the GKS routine GSPLCI to set the polyline color index. The PWRZI routine should only be called after ISOSRF is called.

Line 1 of the fispwrzi.f code segment sets the line color by specifying a color index in the GKS color table. The color table was set up prior to entering this code segment by calling the GKS routine GSCR. This effectively sets the color of the lines drawn by ISOSRF in the next line.

Lines 2 and 3 draw an isosurface.

Line 4 sets the ISIZE variable that specifies character width. The value 35 indicates that the characters will be 35 plotter address units in width.

Line 5 sets the line color to a new color table index. This effectively sets the color of the text drawn by the next three PWRZI calls.

Line 6 draws the string 'FRONT' at position (5.,16.,.5). The string is drawn in the negative X direction, and the character is drawn "upright" in the positive Z direction. The coordinate (5.,16.,.5) specifies the center of the string.

Similarly, lines 7 and 8 draw two more strings on the plot at different positions and different orientations.

Line 9 advances the frame.

Drawing pictures with the EZSRFC routine

EZSRFC is used to draw a picture of a 3-D surface represented by a 2-D input array where each array value represents a height. This module demonstrates how to draw a picture with EZSRFC and how to set the line color used to draw the surface.

EZSRFC plot

Code segment from fsrezsrf.f

1       REAL            Z(21,25),  WORK(1096)
2       DATA  ANGH/45./, ANGV/15./
3       CALL GSCR (1,0,1.,1.,1.)
4       CALL GSCR (1,1,0.,0.,1.)
5       DO  20 I=1,21
6          X = .1*FLOAT(I-11)
7          DO  10 J=1,25
8              Y = .1*FLOAT(J-13)
9              Z(I,J) = (X+Y+1./((X-.1)**2+Y**2+.09)-
10     +         1./((X+.1)**2+Y**2+.09))*.25
11  10     CONTINUE
12  20  CONTINUE
13      CALL GSELNT(0)
14      CALL EZSRFC (Z,21,25,ANGH,ANGV,WORK)

Synopsis

      CALL EZSRFC (ZDATA, M, N, ANGH, ANGV, WORK)

Arguments

ZDATA
Real array, Input---The M by N array to be drawn. Each element of the array represents a height of the surface. EZSRFC, unlike the SRFACE routine described in the next module, requires that the entire array be used.

M, N
Integer, Input---The first and second dimensions of ZDATA, respectively.

ANGH
Real, Input---The angle, in degrees, in the X/Y plane to the line of sight (counterclockwise from the plus-X axis).

ANGV
Real, Input---Angle in degrees from the X/Y plane to the line of sight. Positive angles set the line of sight above the surface and negative values below.

WORK
Real array, Workspace---A scratch storage array dimensioned at least 2 * M * N + M + N.

Discussion

EZSRFC should only be used if the entire input array of heights (ZDATA) is to be drawn, the data points are equally spaced in the X/Y plane, there are no stereo pairs (two pictures) to be drawn, and scaling is chosen internally. Otherwise, you must use the SRFACE routine.

Line 1 of the fsrezsrf.f code segment declares the data array and workspace arrays.

Line 2 sets the variables that represent the line of sight angles.

Line 3 sets the background color of the plot.

Line 4 sets the foreground color of the plot. EZSRFC uses the color represented by color index 1 in the GKS color table to color the lines it draws.

Lines 5 through 12 initialize the input data array with height values that represent the surface to be drawn.

Line 13 selects the identity transformation in which both the window and viewport have the range of 0. to 1. in both dimensions.

Line 14 draws the surface.

Note that the routine FRAME does not need to be called when using the EZSRFC routine; it is called internally.

Drawing pictures with the SRFACE routine

SRFACE is a more general purpose surface-drawing routine than EZSRFC. SRFACE, for example, supports subsampling data and drawing stereo pairs. This module demonstrates how to draw a surface with the SRFACE routine.

SRFACE plot

Code segment from fsrsrfac.f

1       REAL XX(21), YY(25), Z(21,25), S(6), WORK(1096)
2       DATA S(1), S(2), S(3), S(4), S(5), S(6)
3      + /-8.0, -6.0,  3.0,  0.0,  0.0,  0.0/
4
5       CALL GSCR (1,0,1.,1.,1.)
6       CALL GSCR (1,1,0.,0.,1.)
7       CALL GSELNT(0)
8       CALL SRFACE (XX,YY,Z,WORK,21,15,12,S,0.)

Synopsis

      CALL SRFACE (XCOORD, YCOORD, ZDATA, WORK, MX, NX, NY, EYE, STEREO)

Arguments

XCOORD, YCOORD
Real array, Input---Linear arrays of X and Y coordinates, respectively, of the surface. The length of XCOORD is NX, and the length of YCOORD is NY.

ZDATA
Real array, Input---The MX by NY array to be drawn. Each element of the array represents a height of the surface. The units of the array elements are assumed to be in the same units as XCOORD and YCOORD and not wildly different in magnitude. For example, if XCOORD and YCOORD range from 0 to 10,000, and ZDATA ranges from 0 to 1, a flat plane will be drawn. For the best results, the ranges of XCOORD, YCOORD, and ZDATA should be roughly the same.

WORK
Real array, Workspace---A scratch array of at least 2 * NX * NY words long.

MX
Integer, Input---The first dimension of ZDATA.

NX
Integer, Input---The number of data values in the X direction (the first subscript direction) in ZDATA to be plotted. When plotting an entire array, MX=NX.

NY
Integer, Input---The number of data values in the Y direction in ZDATA to be plotted.

EYE
Real array, Input---EYE is a six-element array that defines the line of sight. The units of EYE are assumed to be in the same units as XCOORD and YCOORD. The viewer's eye is at coordinate (EYE(1), EYE(2), EYE(3)), and the point looked at is at coordinate (EYE(4), EYE(5), EYE(6)). The eye should be outside the bounding box of the data that has opposite corners at (XCOORD(1), YCOORD(1), minimum value in ZDATA) and (XCOORD(NX), YCOORD(NY), maximum value in ZDATA).

For a nice perspective effect, the distance between the eye and the point looked at should be 5 to 10 times the size of the bounding box.

STEREO
Real, Input---Flag to indicate if stereo pairs are to be drawn. The value 0.0 means no stereo pair (one picture). Nonzero values mean to create two pictures. The value of STEREO is the relative angle between the eyes. A value of 1.0 produces a standard separation. A negative value of STEREO reverses the left and right figures.

Discussion

The fsrsrfac.f code segment demonstrates how to use the SRFACE routine to draw a 3-D surface.

Line 1 declares the dimensions of the XCOORD and YCOORD coordinate arrays, the ZDATA array, the EYE array, and the WORK array, respectively.

Lines 2 and 3 initialize the coordinates of the eyepoint and the point looked at.

Line 5 sets the background color of the plot to white.

Line 6 sets the foreground color of the plot to blue. The default line color of pictures drawn by SRFACE is set to color index 1 (the foreground color). Therefore, the color of surface lines can be changed by setting the foreground color (color table index 1).

Lines 7 selects the identity transformation in which both the window and viewport have the range of 0. to 1. in both dimensions.

Line 8 draws the surface. In this example, the NX and NY arguments are set to 15 and 12, respectively. The dimensions the ZDATA argument, however, are 21 by 25. This results in subsampling the data.

Note that the routine FRAME was not called to advance the frame. FRAME is called automatically when using the SRFACE routine.

Drawing text in 3-space when using SRFACE

PWRZS is a character-plotting routine used to draw characters in 3-space when using the SRFACE routine. The PWRZS routine lets you position text at any position and orientation in the plot.

This module demonstrates how to use PWRZS to draw text when using the SRFACE routine and how to set the text colors.

Code segment from fsrpwrzs.f

1       CALL GSELNT (0)
2       CALL SRFACE (X,Y,Z,MM,M,M,N,S,0.)
3       CALL GSPLCI(2)
4       ISIZE = 35
5       CALL PWRZS (0.,1.1,0.,'FRONT',5,ISIZE,-1,3,0)
6       CALL PWRZS (1.1,0.,0.,'SIDE',4,ISIZE,2,-1,0)
7       CALL PWRZS (0.,-1.1,.2,' BACK BACK BACK BACK BACK',25,ISIZE,-1,3,0)

Synopsis

      CALL PWRZS (X, Y, Z, LABEL, N, ISIZE, LINE, ITOP, ICNT)
X, Y, Z
Real, Input---The positioning coordinates for the characters to be drawn. These are floating point numbers in the same 3-space coordinate system used in SRFACE.

LABEL
Character, Input---Specifies the character string to be drawn. PWRZS only draws uppercase characters, so LABEL must be a string of all uppercase characters.

N
Integer, Input---Specifies the number of characters in LABEL.

ISIZE
Integer, Input---Specifies the size of characters to be used.

If ISIZE is between 0 and 3, the value specifies 1., 1.5, 2., or 3. times a standard width equal to 1/128th of the screen width.

If ISIZE is greater than 3, the value specifies a character width in plotter address units (by default, 1 plotter address unit is 1/1024th of the screen width).

LINE
Integer, Input---Specifies the coordinate direction in which the characters are written.

+1
Draws text in the +X direction.
-1
Draws text in the -X direction.
+2
Draws text in the +Y direction.
-2
Draws text in the -Y direction.
+3
Draws text in the +Z direction.
-3
Draws text in the -Z direction.

ITOP
Integer, Input---Specifies the coordinate direction from the center of the first character to the top of the first character. Valid values for ITOP are the same as those for LINE, given above. Note that the absolute value of LINE cannot equal the absolute value of ITOP.

ICNT
Integer, Input---Specifies the centering option.

-1
(X,Y,Z) is the center of the left edge of the first character.
0
(X,Y,Z) is the center of the entire string.
+1
(X,Y,Z) is the center of the right edge of the last character.

Discussion

PWRZS is a limited text-drawing routine for labeling surfaces in 3-space. There is only one font, and lowercase characters will not be printed. Character color is controlled by calling the GKS routine GSPLCI to set the polyline color index. The PWRZS routine should be called after SRFACE is called.

Line 1 of the fsrpwrzs.f code segment sets the identity transformation in which both the window and viewport have the range of 0. to 1. in both directions.

Line 2 draws a surface. The arguments to this call were set prior to entering this code segment.

Line 3 sets the polyline color index to 2. The characters drawn with PWRZS will use the color set by the GKS routine GSPLCI.

Line 4 sets the ISIZE variable that specifies character width. The value 35 indicates that the characters will be 35 plotter address units in width.

Line 5 draws the string 'FRONT' at position (0.,1.1,0.). The string is drawn in the negative X direction, and the character is drawn "upright" in the positive Z direction. The coordinate (0.,1.1,0.) specifies the center of the string.

Similarly, lines 6 and 7 draw two more strings on the plot at different positions and different orientations.

Previous chapter          LLUs Home          Next chapter          Index