aboutsummaryrefslogtreecommitdiff
path: root/demo/sgi/gl_panel/twoview/block.py
diff options
context:
space:
mode:
authorSkip Montanaro <[email protected]>2021-02-16 20:14:16 -0600
committerSkip Montanaro <[email protected]>2021-02-16 20:14:16 -0600
commitc2587c76f1b416cdbecb979e54941933246bf856 (patch)
treebb61ee9128075ce22af4eafa232f13c2e5a07896 /demo/sgi/gl_panel/twoview/block.py
parentd90761a005b24018ae237bf551515772a1de656f (diff)
downloadpython-0.9.1-patched-QoL-c2587c76f1b416cdbecb979e54941933246bf856.tar.xz
python-0.9.1-patched-QoL-c2587c76f1b416cdbecb979e54941933246bf856.zip
starting over
Diffstat (limited to 'demo/sgi/gl_panel/twoview/block.py')
-rw-r--r--demo/sgi/gl_panel/twoview/block.py124
1 files changed, 62 insertions, 62 deletions
diff --git a/demo/sgi/gl_panel/twoview/block.py b/demo/sgi/gl_panel/twoview/block.py
index 9ac518d..a40c8e9 100644
--- a/demo/sgi/gl_panel/twoview/block.py
+++ b/demo/sgi/gl_panel/twoview/block.py
@@ -7,67 +7,67 @@ from GL import MATERIAL
# Arguments are the material indices (0 = don't call lmbind)
#
def block(m_front, m_back, m_left, m_right, m_top, m_bottom):
- #
- # Distances defining the sides
- #
- x_left = -1.0
- x_right = 1.0
- y_top = 1.0
- y_bottom = -1.0
- z_front = 1.0
- z_back = -1.0
- #
- # Top surface points: A, B, C, D
- #
- A = x_right, y_top, z_front
- B = x_right, y_top, z_back
- C = x_left, y_top, z_back
- D = x_left, y_top, z_front
- #
- # Bottom surface points: E, F, G, H
- #
- E = x_right, y_bottom, z_front
- F = x_right, y_bottom, z_back
- G = x_left, y_bottom, z_back
- H = x_left, y_bottom, z_front
- #
- # Draw front face
- #
- if m_front: lmbind(MATERIAL, m_front)
- n3f(0.0, 0.0, 1.0)
- face(H, E, A, D)
- #
- # Draw back face
- #
- if m_back: lmbind(MATERIAL, m_back)
- n3f(0.0, 0.0, -1.0)
- face(G, F, B, C)
- #
- # Draw left face
- #
- if m_left: lmbind(MATERIAL, m_left)
- n3f(-1.0, 0.0, 0.0)
- face(G, H, D, C)
- #
- # Draw right face
- #
- if m_right: lmbind(MATERIAL, m_right)
- n3f(1.0, 0.0, 0.0)
- face(F, E, A, B)
- #
- # Draw top face
- #
- if m_top: lmbind(MATERIAL, m_top)
- n3f(0.0, 1.0, 0.0)
- face(A, B, C, D)
- #
- # Draw bottom face
- #
- if m_bottom: lmbind(MATERIAL, m_bottom)
- n3f(0.0, -1.0, 0.0)
- face(E, F, G, H)
+ #
+ # Distances defining the sides
+ #
+ x_left = -1.0
+ x_right = 1.0
+ y_top = 1.0
+ y_bottom = -1.0
+ z_front = 1.0
+ z_back = -1.0
+ #
+ # Top surface points: A, B, C, D
+ #
+ A = x_right, y_top, z_front
+ B = x_right, y_top, z_back
+ C = x_left, y_top, z_back
+ D = x_left, y_top, z_front
+ #
+ # Bottom surface points: E, F, G, H
+ #
+ E = x_right, y_bottom, z_front
+ F = x_right, y_bottom, z_back
+ G = x_left, y_bottom, z_back
+ H = x_left, y_bottom, z_front
+ #
+ # Draw front face
+ #
+ if m_front: lmbind(MATERIAL, m_front)
+ n3f(0.0, 0.0, 1.0)
+ face(H, E, A, D)
+ #
+ # Draw back face
+ #
+ if m_back: lmbind(MATERIAL, m_back)
+ n3f(0.0, 0.0, -1.0)
+ face(G, F, B, C)
+ #
+ # Draw left face
+ #
+ if m_left: lmbind(MATERIAL, m_left)
+ n3f(-1.0, 0.0, 0.0)
+ face(G, H, D, C)
+ #
+ # Draw right face
+ #
+ if m_right: lmbind(MATERIAL, m_right)
+ n3f(1.0, 0.0, 0.0)
+ face(F, E, A, B)
+ #
+ # Draw top face
+ #
+ if m_top: lmbind(MATERIAL, m_top)
+ n3f(0.0, 1.0, 0.0)
+ face(A, B, C, D)
+ #
+ # Draw bottom face
+ #
+ if m_bottom: lmbind(MATERIAL, m_bottom)
+ n3f(0.0, -1.0, 0.0)
+ face(E, F, G, H)
def face(points):
- bgnpolygon()
- varray(points)
- endpolygon()
+ bgnpolygon()
+ varray(points)
+ endpolygon()