Next: 3.2 Graphics instructions: 2D
Up: 3 Creating a 2D image
Prev: 3 Creating a 2D image
Contents
The independence of FORTRAN 3D with respect to the type of terminal used was mentioned earlier. We also talked about the vitual screen on which the object is constructed before producing the image. In this section we deal with the coordinates of this screen using a unitary system chosen by the user (Angström, centimeter, kilometer, light-year!...) with respect to the dimensions of the real object. This is the MASK.
If we wish the entire object to be visualized, all the points must be inside the mask . If the mask is too large, the object will appear small, and if the dimensions of the object are bigger that those of the mask, the entire object will not be seen. Thus, by playing with the coordinate system and the object's units, we eliminate the notion of screen coordinates advantageously.
SUBROUTINE MASQU2(XMIN, XMAX, YMIN, YMAX) REAL XMIN, XMAX, YMIN, YMAX
This subroutine defines a rectangular mask whose lower left corner is the point (XMIN, YMIN) and the upper right corner is the point (XMAX, YMAX). This mask is, by default, equal to the frame defined on the visualization surface. Only the parts of the object falling inside this mask are retained.
zoom1.psfig:471Initial plotzoom2.psfig:471bZoom by changing the mask
It is necessary, secondly, to define a frame on the visualization surface which will contain the image inside the mask. For a plane object, this frame is defined using the following subroutines:
SUBROUTINE FENTR2(XMIN, XMAX, YMIN, YMAX) REAL XMIN, XMAX, YMIN, YMAX
defines a frame on the visualization surface whose lower left corner is the point (XMIN, YMIN) and the upper right corner is the point (XMAX, YMAX). These coordinates are expressed in centimeters.
SUBROUTINE RFENTR(PXMIN, PXMAX, PYMIN, PYMAX) REAL PXMIN, PXMAX, PYMIN, PYMAX
defines a frame on the visualization surface whose lower left corner is the point (PXMIN, PYMIN) and the upper right corner is the point (PXMAX, PYMAX). These coordinates are expressed as a percentage of the real screen.
For certain particular applications, it could be advantageous not to take the clipping defined by MASQU2 into account. It is possible to govern this indicator by using the following subroutines:
SUBROUTINE CLIP(FLAG) LOGICAL FLAG
suppress the clipping defined by MASQU2 if FLAG equals .FALSE.
SUBROUTINE CLIPHD(FLAG) LOGICAL FLAG
hardware clipping, i.e. clipping in the window (instead of in the mask).