Debian Codegraph @

packages/seacas/libraries/plt/mpwind.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 MPWIND(LEFT,RIGHT,BOTTOM,TOP,NEAR,FAR)
9 COMMON /MAP/MODEL(4,4),VIEW(4,4),PROJ(4,4),CPNEAR,CPFAR,VWPORT(4),
10 * MVP(4,4),VP(4,4),CPLINE(2,2,10),CPPLAN(2,3,10),PEYE(3),
11 * PLOOK(3),ETWIST,NCPLIN,NCPLAN,TMAT1(4,4),TMAT2(4,4),
12 * TMAT3(4,4),TVEC1(4),TVEC2(4),TVEC3(4),TVEC4(4),TARR1(32),
13 * TARR2(32),TARR3(32),TARR4(32),TARR5(32),TARR6(32),
14 * TARR7(32),TARR8(32)
15 REAL MODEL,MVP
16 REAL LEFT,NEAR
17 CHARACTER*6 SUBNAM
18 PARAMETER (SUBNAM='MPWIND')
19
20 MPWIND = .FALSE.
21 IF (NEAR.LT.0.) THEN
22 CALL PLTFLU
23 CALL SIORPT(SUBNAM,
24 * 'You cannot specify the near clipping plane less than 0.'
25 * ,2)
26 RETURN
27
28 END IF
29
30 IF (NEAR.GE.FAR) THEN
31 CALL PLTFLU
32 CALL SIORPT(SUBNAM,
33 *'You cannot specify the near clipping plane >= to the far clipping
34 * plane',2)
35 RETURN
36
37 END IF
38
39 IF (RIGHT.EQ.LEFT) THEN
40 CALL PLTFLU
41 CALL SIORPT(SUBNAM,
42 *'You cannot specify the right and left edges of the viewing frustr
43 *um as equal',2)
44 RETURN
45
46 END IF
47
48 IF (TOP.EQ.BOTTOM) THEN
49 CALL PLTFLU
50 CALL SIORPT(SUBNAM,
51 *'You cannot specify the top and bottom edges of the viewing frustr
52 *um as equal',2)
53 RETURN
54
55 END IF
56
57 MPWIND = .TRUE.
58 CALL MXZERO(4,PROJ)
59 PROJ(1,1) = 2.*NEAR/ (RIGHT-LEFT)
60 PROJ(2,2) = 2.*NEAR/ (TOP-BOTTOM)
61 PROJ(3,1) = (RIGHT+LEFT)/ (RIGHT-LEFT)
62 PROJ(3,2) = (TOP+BOTTOM)/ (TOP-BOTTOM)
63 PROJ(3,3) = - (FAR+NEAR)/ (FAR-NEAR)
64 PROJ(3,4) = -1.
65 PROJ(4,3) = - (2.*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