MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / main

Function main

pyPBD/examples/cloth_model.py:122–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120 buildModel()
121
122def main():
123 # Activate logger to output info on the console
124 pbd.Logger.addConsoleSink(pbd.LogLevel.INFO)
125
126 # init OpenGL
127 initGL(1280, 1024)
128 gluLookAt (5, 10, 20, 5, -5, 0, 0, 1, 0)
129 glRotatef(20.0, 0, 1, 0)
130
131 # build simulation model
132 buildModel()
133
134 # start event loop
135 running = True
136 while running:
137 for event in pygame.event.get():
138 if event.type == pygame.QUIT:
139 running = False
140 if event.type == pygame.KEYDOWN:
141 if event.key == pygame.K_r:
142 reset()
143 if event.key == pygame.K_ESCAPE:
144 running = False
145
146 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
147 glClearColor(0.3, 0.3, 0.3, 1.0)
148 timeStep()
149 render()
150 pygame.display.flip()
151
152 pygame.quit()
153 pbd.Timing.printAverageTimes()
154
155if __name__ == "__main__":
156 main()

Callers 1

cloth_model.pyFile · 0.70

Calls 7

initGLFunction · 0.85
printAverageTimesMethod · 0.80
buildModelFunction · 0.70
resetFunction · 0.70
timeStepFunction · 0.70
renderFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected