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

Function render

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

Source from the content-addressed store, hash-verified

97
98# Render all bodies
99def render():
100 sim = pbd.Simulation.getCurrent()
101 model = sim.getModel()
102
103 # render meshes of rigid bodies
104 rbs = model.getRigidBodies()
105 for rb in rbs:
106 vd = rb.getGeometry().getVertexData()
107 mesh = rb.getGeometry().getMesh()
108 drawMesh(vd, mesh, 0, [0,0.2,0.7])
109
110 # render mesh of tet model
111 pd = model.getParticles()
112 tetModel = model.getTetModels()[0]
113 offset = tetModel.getIndexOffset()
114 drawMesh(pd, tetModel.getSurfaceMesh(), offset, [0,0.2,0.7])
115
116 # render time
117 glPushMatrix()
118 glLoadIdentity()
119 drawText([-0.95,0.9], "Time: {:.2f}".format(pbd.TimeManager.getCurrent().getTime()))
120 glPopMatrix()
121
122# Perform simulation steps
123def 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