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

Function main

pyPBD/examples/armadillo.py:144–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142 buildModel()
143
144def main():
145 # Activate logger to output info on the console
146 pbd.Logger.addConsoleSink(pbd.LogLevel.INFO)
147
148 # init OpenGL
149 initGL(1280, 1024)
150 gluLookAt (0, 10, -20, 0, 0, 0, 0, 1, 0)
151 glRotatef(20.0, 0, 1, 0)
152
153 # build simulation model
154 buildModel()
155
156 # start event loop
157 running = True
158 while running:
159 for event in pygame.event.get():
160 if event.type == pygame.QUIT:
161 running = False
162 if event.type == pygame.KEYDOWN:
163 if event.key == pygame.K_r:
164 reset()
165 if event.key == pygame.K_ESCAPE:
166 running = False
167
168 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
169 glClearColor(0.3, 0.3, 0.3, 1.0)
170 timeStep()
171 render()
172 pygame.display.flip()
173
174 pygame.quit()
175 pbd.Timing.printAverageTimes()
176
177if __name__ == "__main__":
178 main()

Callers 1

armadillo.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