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

Function render

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

Source from the content-addressed store, hash-verified

85
86# Render all bodies
87def render():
88 sim = pbd.Simulation.getCurrent()
89 model = sim.getModel()
90
91 # render mesh of cloth model
92 pd = model.getParticles()
93 triModel = model.getTriangleModels()[0]
94 offset = triModel.getIndexOffset()
95 drawMesh(pd, triModel.getParticleMesh(), offset, [0,0.3,0.8])
96
97 # render time
98 glPushMatrix()
99 glLoadIdentity()
100 drawText([-0.95,0.9], "Time: {:.2f}".format(pbd.TimeManager.getCurrent().getTime()))
101 glPopMatrix()
102
103# Perform simulation steps
104def timeStep():

Callers 1

mainFunction · 0.70

Calls 7

drawMeshFunction · 0.85
drawTextFunction · 0.85
getModelMethod · 0.80
getTimeMethod · 0.80
getCurrentMethod · 0.45
getIndexOffsetMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected