Debian Codegraph @

packages/seacas/libraries/plt/mport3.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 LOGICAL FUNCTION MPORT3(LEFT,RIGHT,BOTTOM,TOP,NEAR,FAR)
9 REAL LEFT,NEAR
10 CHARACTER*6 SUBNAM
11 PARAMETER (SUBNAM='MPORT3')
12 COMMON /MAP/MODEL(4,4),VIEW(4,4),PROJ(4,4),CPNEAR,CPFAR,VWPORT(4),
13 * MVP(4,4),VP(4,4),CPLINE(2,2,10),CPPLAN(2,3,10),PEYE(3),
14 * PLOOK(3),ETWIST,NCPLIN,NCPLAN,TMAT1(4,4),TMAT2(4,4),
15 * TMAT3(4,4),TVEC1(4),TVEC2(4),TVEC3(4),TVEC4(4),TARR1(32),
16 * TARR2(32),TARR3(32),TARR4(32),TARR5(32),TARR6(32),
17 * TARR7(32),TARR8(32)
18 REAL MODEL,MVP
19
20 MPORT3 = .FALSE.
21 IF (RIGHT.EQ.LEFT) THEN
22 CALL PLTFLU
23 CALL SIORPT(SUBNAM,
24 *'You cannot specify the right and left edges of the clipping recta
25 *ngle as equal',2)
26 RETURN
27
28 END IF
29
30 IF (TOP.EQ.BOTTOM) THEN
31 CALL PLTFLU
32 CALL SIORPT(SUBNAM,
33 *'You cannot specify the top and bottom edges of the clipping recta
34 *ngle as equal',2)
35 RETURN
36
37 END IF
38
39 IF (NEAR.LT.0.) THEN
40 CALL PLTFLU
41 CALL SIORPT(SUBNAM,
42 * 'You cannot specify the near clipping plane less than 0.'
43 * ,2)
44 RETURN
45
46 END IF
47
48 IF (NEAR.GE.FAR) THEN
49 CALL PLTFLU
50 CALL SIORPT(SUBNAM,
51 *'You cannot specify the near clipping plane >= to the far clipping
52 * plane',2)
53 RETURN
54
55 END IF
56
57 MPORT3 = .TRUE.
58 CALL MXZERO(4,PROJ)
59 PROJ(1,1) = 2./ (RIGHT-LEFT)
60 PROJ(2,2) = 2./ (TOP-BOTTOM)
61 PROJ(3,3) = -2./ (FAR-NEAR)
62 PROJ(4,4) = 1.
63 PROJ(4,1) = - (RIGHT+LEFT)/ (RIGHT-LEFT)
64 PROJ(4,2) = - (TOP+BOTTOM)/ (TOP-BOTTOM)
65 PROJ(4,3) = - (FAR+NEAR)/ (FAR-NEAR)
66 CPNEAR = NEAR
67 CPFAR = FAR
68 CALL MXMULT(4,VIEW,PROJ,VP)
69 CALL MXMULT(4,MODEL,VP,MVP)
70 RETURN
71
72 END