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

Function main

pyPBD/examples/chain_model.py:111–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109 buildModel()
110
111def main():
112 # Activate logger to output info on the console
113 pbd.Logger.addConsoleSink(pbd.LogLevel.INFO)
114
115 # init OpenGL
116 initGL(1280, 1024)
117 initLights()
118 gluLookAt (1.5, -2, 20, 1.5, -2, 0, 0, 1, 0)
119
120 # build simulation model
121 buildModel()
122
123 # start event loop
124 running = True
125 while running:
126 for event in pygame.event.get():
127 if event.type == pygame.QUIT:
128 running = False
129 if event.type == pygame.KEYDOWN:
130 if event.key == pygame.K_r:
131 reset()
132 if event.key == pygame.K_ESCAPE:
133 running = False
134
135 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
136 glClearColor(0.3, 0.3, 0.3, 1.0)
137 timeStep()
138 render()
139 pygame.display.flip()
140
141 pygame.quit()
142 pbd.Timing.printAverageTimes()
143
144if __name__ == "__main__":
145 main()

Callers 1

chain_model.pyFile · 0.70

Calls 8

initGLFunction · 0.85
initLightsFunction · 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