📄 node83.html
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2 Final//FR"><!-- Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) --><!-- by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds --><!-- Modified Simulog 03/97 --><HTML><HEAD><TITLE>4.5 3D graphics instructions</TITLE><LINK REL=STYLESHEET TYPE="text/css" HREF="./Modulef.css" TITLE="Modulef CSS"><meta name="description" value="4.5 3D graphics instructions"><meta name="keywords" value="Guide6"><meta name="resource-type" value="document"><meta name="distribution" value="global"></HEAD><BODY BGCOLOR="#FFFFFF"><P> <IMG SRC="../icons/smallmod.gif" WIDTH=211 HEIGHT=50 ALIGN=BOTTOM ALT="Modulef"><A NAME=tex2html1448 HREF="node82.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/previous_motif.gif" ALT="previous"></A><A NAME=tex2html1454 HREF="node78.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/up_motif.gif" ALT="up"></A><A NAME=tex2html1456 HREF="node84.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/next_motif.gif" ALT="next"></A><A NAME=tex2html1458 HREF="node2.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/contents_motif.gif" ALT="contents"></A><A HREF="../Guide6-18/node83.html"><IMG BORDER=0 SRC="../icons/zoom18.gif" ALIGN=BOTTOM ALT="[BIG]"></A><A HREF="../Guide6-14/node83.html"><IMG BORDER=0 SRC="../icons/zoom14.gif" ALIGN=BOTTOM ALT="[Normal]"></A><A HREF="../Guide6-10/node83.html"><IMG BORDER=0 SRC="../icons/zoom10.gif" ALIGN=BOTTOM ALT="[small]"></A><BR><B> Next: </B> <A NAME=tex2html1457 HREF="node84.html">4.6 Texts</A><B>Up: </B> <A NAME=tex2html1455 HREF="node78.html">4 Creating a 3D image</A><B> Prev: </B> <A NAME=tex2html1449 HREF="node82.html">4.4 The transformations</A><B><A HREF="node2.html" >Contents</A></B><HR SIZE=3 WIDTH="75%"><H1><A NAME=SECTION05450000000000000000>4.5 3D graphics instructions</A></H1><P><P><P>The elementary components are assumed to be created using a fictive cursor which is independent of the cursor defined in 2D.<P><UL><LI><P><PRE> SUBROUTINE MOV3TO(X, Y, Z) REAL X, Y, Z</PRE><P>moves the<A NAME=3176> </A> cursor to the points with coordinates (X, Y, Z).<P><LI><P><PRE> SUBROUTINE MOV3OF(U, V, W) REAL U, V, W</PRE><P>moves the cursor<A NAME=3177> </A> by a vector (U, V, W).<P><LI><P><PRE> SUBROUTINE LIN3TO(X, Y, Z) REAL X, Y, Z</PRE><P>creates a line segment<A NAME=3178> </A> <A NAME=3179> </A> starting at the current cursor position and endingat the point with coordinates (X, Y, Z). The end-point becomes the current cursor position.<P><LI><P><PRE> SUBROUTINE LIN3OF(U, V, W) REAL U, V, W</PRE><P>creates a<A NAME=3180> </A> line segment of vector (U, V, W) starting from the current cursor position.The segment's end-point becomes the current cursor position.<P><LI><P><PRE> SUBROUTINE POLY3F(X, Y, Z, NB, CFAC, CCONT, IFALG) INTEGER NB, CFAC, CCONT, IFALG REAL X(NB), Y(NB), Z(NB)</PRE><P>creates a<A NAME=3181> </A> facet with NB vertices (NB <b><</b> 50), where:<P><UL><LI> X(NB), Y(NB), Z(NB): vertex coordinates of the facet.<LI> NB : Number of vertices in the facet.<LI> CFAC : facet color<LI> CCONT : contour color<LI> IFLAG : plot option<DL COMPACT><DT>.<DD> 0 : plot of facet only<P><DT>.<DD> 1 : plot of contour only<P><DT>.<DD> 2 : plot of facet and contour<P> </DL></UL><P>This subroutine colors in the facet on the surface bounded by the projection of the contourof 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 tothe 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.<P><P><P>In general, for 2D as well as in 3D, the facets can be defined in the following manner:<P><LI><P><PRE> SUBROUTINE DEBFAC(ITYP) INTEGER ITYP</PRE><P> indicates the start<A NAME=3186> </A> of the facet's description. This description is done by defining the line segments constituting the facet's polygonal contour.<P><UL><LI> If ITYP = 0 : Definition of the external contour<LI> If ITYP = 1 : Definition of a hole</UL><P><LI><P><PRE> SUBROUTINE FINFAC</PRE><P>indicates the end<A NAME=3189> </A> of the sequence of the facet's description.<P><LI><P><PRE> SUBROUTINE CURVE3(TX, TY, TZ, NB) REAL TX(NB), TY(NB), TZ(NB) INTEGER NB</PRE><P>plots the<A NAME=3190> </A> broken line with NB vertices whose coordinates are given in arraysTX, TY and TZ. At the end of the plot, the current cursor position is the last vertex position.<P> <LI><P><PRE> SUBROUTINE CURVE(TX, TY, NB) REAL TX(NB), TY(NB) INTEGER NB</PRE><P>plots, in the plane<A NAME=3191> </A> XOY, the <A NAME=3192> </A> broken line with NB vertices whose csuccessive 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.).<P><LI><P><PRE> SUBROUTINE POLGON(R, A, NB) REAL R, A INTEGER NB</PRE><P>plots, in the <A NAME=3193> </A> 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 thepositive trigonometric direction. At the end of the plot, the current cursor position is at the arc's end-point.<P><LI><P><PRE> SUBROUTINE CIRCLE(R, NB) REAL R INTEGER NB</PRE><P>plots, in the <A NAME=3194> </A> 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.).<P><LI><P><PRE> SUBROUTINE CRCLCP(XC, YC, X, Y, NB) REAL XC, YC, X, Y INTEGER NB</PRE><P>plots, in the <A NAME=3195> </A> 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.).<P><LI><P><PRE> SUBROUTINE ARC(A, TC, TP, NB) REAL A, TC(2), TP(2) INTEGER NB</PRE><P>plots, in the <A NAME=3196> </A> 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 radiansin the positive trigonometric direction.At the end of the plot, the current cursor position is at the arc's end-point.<P><LI><P><PRE> SUBROUTINE ARC2P(TC, TP, NB) REAL TC(2), TP(4) INTEGER NB</PRE><P>plots, in the <A NAME=3197> </A> XOY plane, the regular polygon with NB sides approaching the arc of the circlecentered 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 theline going through this point and the origin).At the end of the plot, the current cursor position is the arc's end-point.<P><LI><P><PRE> SUBROUTINE PRISMM(H, TP, NB) REAL H, TP(2, NB) INTEGER NB</PRE><P>plots the edges<A NAME=3198> </A> of a right prism of length H, whose base, situated in XOY plane, is definedby the closed polygonal contour where the successive coordinates of the NBvertices 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).<P><LI><P><PRE> SUBROUTINE REVOL(C, NBCB, NC) REAL C(2, NBCB) INTEGER NBCB NC</PRE><P>plots the<A NAME=3199> </A> 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.).<P><LI><P><PRE> SUBROUTINE CARRE</PRE><P>plots, in the first<A NAME=3200> </A> quadrant in XOY plane , a square with sides 1., with lower left vertexat the origin.At the end of the plot, the current cursor position is the origin.<P><LI><P><PRE> SUBROUTINE CUBE</PRE><P>plots the edges of a cube with sides 1., touching the three axes, situated in the positivetrihedron 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.).<P><LI><P><PRE> SUBROUTINE TRIEDR</PRE><P>plots a<A NAME=3201> </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.<P> <LI><P><PRE> SUBROUTINE WPRISM(S, NB, D, H, BOUTS, DERFAC) INTEGER BOUTS REAL S(2, NB), D(3), H LOGICAL DERFAC</PRE><P>This subroutine is identical to <A NAME=3202> </A> subroutine PRISMM, but with colored-in facets:<P><UL><LI> S : section of the prism in the XOY plane<LI> NB: number of vertices in this section<LI> D : vector, direction of the generating line<LI> H : prism height in Z<P>Translational vector between sections Z = 0 and Z = H. <LI> BOUTS: Option to close the faces:<DL COMPACT><DT>.<DD> 0 do not close the face extremities<P><DT>.<DD> 1 close face 1 (Z = 0)<P><DT>.<DD> 2 close face 2 (Z = H)<P><DT>.<DD> 3 close both faces<P> </DL><LI> DERFAC: If .TRUE. close the last facet (closed polygon)<P> If .FALSE. do not close the last facet (open polygon)</UL><P><LI><P><PRE> SUBROUTINE WCUBE(C) REAL C</PRE><P>plots a <A NAME=3207> </A> cube with edges C (see CUBE).<P><LI><P><PRE> SUBROUTINE WREVOL(C, NBCB, N, FONDS, ICOUL) REAL C(2, NBCB) LOGICAL FONDS</PRE><P>This subroutine is identical to<A NAME=3208> </A> subroutine REVOL, but with coloring-in of facets:<UL><LI> NBCN: Number of points on the curve<LI> N: Number of points on the circles<LI> FONDS=.TRUE. if the bottoms are plotted (basis of the object) </UL></UL><P><P><P><HR SIZE=3 WIDTH="75%"><IMG SRC="../icons/smallmod.gif" WIDTH=211 HEIGHT=50 ALIGN=BOTTOM ALT="Modulef"><A NAME=tex2html1448 HREF="node82.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/previous_motif.gif" ALT="previous"></A><A NAME=tex2html1454 HREF="node78.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/up_motif.gif" ALT="up"></A><A NAME=tex2html1456 HREF="node84.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/next_motif.gif" ALT="next"></A><A NAME=tex2html1458 HREF="node2.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/contents_motif.gif" ALT="contents"></A><A HREF="../Guide6-18/node83.html"><IMG BORDER=0 SRC="../icons/zoom18.gif" ALIGN=BOTTOM ALT="[BIG]"></A><A HREF="../Guide6-14/node83.html"><IMG BORDER=0 SRC="../icons/zoom14.gif" ALIGN=BOTTOM ALT="[Normal]"></A><A HREF="../Guide6-10/node83.html"><IMG BORDER=0 SRC="../icons/zoom10.gif" ALIGN=BOTTOM ALT="[small]"></A><BR><B> Next: </B> <A NAME=tex2html1457 HREF="node84.html">4.6 Texts</A><B>Up: </B> <A NAME=tex2html1455 HREF="node78.html">4 Creating a 3D image</A><B> Prev: </B> <A NAME=tex2html1449 HREF="node82.html">4.4 The transformations</A><B><A HREF="node2.html" >Contents</A></B><BR> <HR><P><ADDRESS></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -