Next: 4.6 Texts
Up: 4 Creating a 3D image
Prev: 4.4 The transformations
Contents
The elementary components are assumed to be created using a fictive cursor which is independent of the cursor defined in 2D.
SUBROUTINE MOV3TO(X, Y, Z) REAL X, Y, Z
moves the cursor to the points with coordinates (X, Y, Z).
SUBROUTINE MOV3OF(U, V, W) REAL U, V, W
moves the cursor by a vector (U, V, W).
SUBROUTINE LIN3TO(X, Y, Z) REAL X, Y, Z
creates a line segment starting at the current cursor position and ending at the point with coordinates (X, Y, Z). The end-point becomes the current cursor position.
SUBROUTINE LIN3OF(U, V, W) REAL U, V, W
creates a line segment of vector (U, V, W) starting from the current cursor position. The segment's end-point becomes the current cursor position.
SUBROUTINE POLY3F(X, Y, Z, NB, CFAC, CCONT, IFALG) INTEGER NB, CFAC, CCONT, IFALG REAL X(NB), Y(NB), Z(NB)
creates a facet with NB vertices (NB < 50), where:
This subroutine colors in the facet on the surface bounded by the projection of the contour of the facet on the 2D mask defined by a call of PRSPCT. If the facet is curved in the 3D space and if part of its surface is hidden by another part closer to the observer, there is a risk that it will not be completely colored in. The same remark, regarding the clipping of non-convex facets, applies here as for POLY2F.
In general, for 2D as well as in 3D, the facets can be defined in the following manner:
SUBROUTINE DEBFAC(ITYP) INTEGER ITYP
indicates the start of the facet's description. This description is done by defining the line segments constituting the facet's polygonal contour.
SUBROUTINE FINFAC
indicates the end of the sequence of the facet's description.
SUBROUTINE CURVE3(TX, TY, TZ, NB) REAL TX(NB), TY(NB), TZ(NB) INTEGER NB
plots the broken line with NB vertices whose coordinates are given in arrays TX, TY and TZ. At the end of the plot, the current cursor position is the last vertex position.
SUBROUTINE CURVE(TX, TY, NB) REAL TX(NB), TY(NB) INTEGER NB
plots, in the plane XOY, the broken line with NB vertices whose c successive coordinates are given in arrays TX and TY. At the end of the plot, the current cursor position is the last vertex position, i.e. (TX(NB), TY(NB), 0.).
SUBROUTINE POLGON(R, A, NB) REAL R, A INTEGER NB
plots, in the XOY plane and starting at axis OX, the regular polyline with NB vertices which approaches an arc of the circle centered at the origin and making an angle A (radians) in the positive trigonometric direction. At the end of the plot, the current cursor position is at the arc's end-point.
SUBROUTINE CIRCLE(R, NB) REAL R INTEGER NB
plots, in the XOY plane, the regular polygon with NB sides approaching the circle with radius R and centered at the origin. At the end of the plot, the current cursor position is (R, 0., 0.).
SUBROUTINE CRCLCP(XC, YC, X, Y, NB) REAL XC, YC, X, Y INTEGER NB
plots, in the XOY plane, the regular polygon with NB sides approaching the circle with center (XC, YC) and going through point (X, Y). At the end of the plot, the current cursor position (X, Y, 0.).
SUBROUTINE ARC(A, TC, TP, NB) REAL A, TC(2), TP(2) INTEGER NB
plots, in the XOY plane, the regular polygon with NB sides approaching the arc of circle centered at (TC(1), TC(2), 0.), with origin at the point (TP(1), TP(2), 0.) and angle A radians in the positive trigonometric direction. At the end of the plot, the current cursor position is at the arc's end-point.
SUBROUTINE ARC2P(TC, TP, NB) REAL TC(2), TP(4) INTEGER NB
plots, in the XOY plane, the regular polygon with NB sides approaching the arc of the circle centered at (TC(1), TC(2), 0.), with origin the point (TP(1), TP(2), 0.), end-point the point (TP(3), TP(4), 0.) and plotted in the trigonometric direction (in fact, the end-point is on the line going through this point and the origin). At the end of the plot, the current cursor position is the arc's end-point.
SUBROUTINE PRISMM(H, TP, NB) REAL H, TP(2, NB) INTEGER NB
plots the edges of a right prism of length H, whose base, situated in XOY plane, is defined by the closed polygonal contour where the successive coordinates of the NB vertices are stored in array TP. At the end of the plot, the current cursor position is the point (TP(1, NB), TP(2, NB), H).
SUBROUTINE REVOL(C, NBCB, NC) REAL C(2, NBCB) INTEGER NBCB NC
plots the edges of a revolution volume obtained from a curve defined in the XOY plane turning around the OY axis. The NBCB vertices of the curve are contained in array C and the circles are composed of NC edges. At the end of the plot, the current cursor position is the point (C(1, NBCB), C(2, NBCB), 0.).
SUBROUTINE CARRE
plots, in the first quadrant in XOY plane , a square with sides 1., with lower left vertex at the origin. At the end of the plot, the current cursor position is the origin.
SUBROUTINE CUBE
plots the edges of a cube with sides 1., touching the three axes, situated in the positive trihedron and with one of the vertices at the origin. At the end of the plot, the current cursor position is the point (0., 1., 1.).
SUBROUTINE TRIEDR
plots a trihedron representing the coordinate axis, with edges of unit length and with the letters X, Y and Z at each of the respective axis end-points. At the end of the plot, the current cursor position is undetermined.
SUBROUTINE WPRISM(S, NB, D, H, BOUTS, DERFAC) INTEGER BOUTS REAL S(2, NB), D(3), H LOGICAL DERFAC
This subroutine is identical to subroutine PRISMM, but with colored-in facets:
Translational vector between sections Z = 0 and Z = H.
If .FALSE. do not close the last facet (open polygon)
SUBROUTINE WCUBE(C) REAL C
plots a cube with edges C (see CUBE).
SUBROUTINE WREVOL(C, NBCB, N, FONDS, ICOUL) REAL C(2, NBCB) LOGICAL FONDS
This subroutine is identical to subroutine REVOL, but with coloring-in of facets: