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

Function main

pyPBD/examples/bunny_cloth.py:173–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171 buildModel()
172
173def main():
174 # Activate logger to output info on the console
175 pbd.Logger.addConsoleSink(pbd.LogLevel.INFO)
176
177 # init OpenGL
178 initGL(1280, 1024)
179 gluLookAt (0, 10, -20, 0, 0, 0, 0, 1, 0)
180 glRotatef(20.0, 0, 1, 0)
181
182 # build simulation model
183 buildModel()
184
185 # start event loop
186 running = True
187 while running:
188 for event in pygame.event.get():
189 if event.type == pygame.QUIT:
190 running = False
191 if event.type == pygame.KEYDOWN:
192 if event.key == pygame.K_r:
193 reset()
194 if event.key == pygame.K_ESCAPE:
195 running = False
196
197 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
198 glClearColor(0.3, 0.3, 0.3, 1.0)
199 timeStep()
200 render()
201 pygame.display.flip()
202
203 pygame.quit()
204 pbd.Timing.printAverageTimes()
205
206if __name__ == "__main__":
207 main()

Callers 1

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