def test_ObjectInfoWnd(): bvhFilePath = '../samples/wd2_WalkSameSame00.bvh' jointMotion1, frameTime = yf.readBvhFileAsJointMotion(bvhFilePath, .01) bvhFilePath = '../samples/wd2_WalkForwardVFast00.bvh' jointMotion2, frameTime = yf.readBvhFileAsJointMotion(bvhFilePath, .01) meshFilePath = '../samples/physics2_woody_binding1.mesh.xml' skinMesh, js = yol.readOgreDataFiles(meshFilePath, .01) meshFilePath = '../samples/physics2_woody_binding1.mesh.xml' mesh = yol.readOgreMeshFileAsMesh(meshFilePath, .01) ysu.mergePoints(skinMesh) ysu.mergePoints(mesh) skinMesh.update(js[0][80]) viewer = SimpleViewer() viewer.doc.addRenderer('motion1(%s)'%jointMotion1.resourceName, yr.JointMotionRenderer(jointMotion1, (0, 0, 255), yr.LINK_LINE)) viewer.doc.addObject('motion1(%s)'%jointMotion1.resourceName, jointMotion1) viewer.doc.addRenderer('motion2(%s)'%jointMotion2.resourceName, yr.JointMotionRenderer(jointMotion2, (0, 0, 255), yr.LINK_LINE)) viewer.doc.addObject('motion2(%s)'%jointMotion1.resourceName, jointMotion2) viewer.doc.addRenderer('skinMesh', yr.MeshRenderer(skinMesh)) viewer.doc.addObject('skinMesh', skinMesh) viewer.doc.addRenderer('mesh', yr.MeshRenderer(mesh)) viewer.doc.addObject('mesh', mesh) viewer.startTimer(frameTime) viewer.show() Fl.run()
def test_MeshRenderer(): meshFilePath = '../samples/woody2_15.mesh.xml' mesh = yol.readOgreMeshFileAsMesh(meshFilePath) viewer = ysv.SimpleViewer() viewer.doc.addRenderer('mesh', MeshRenderer(mesh)) viewer.doc.addObject('mesh', mesh) viewer.startTimer(1. / 30.) viewer.show() Fl.run()
def test_submesh(): meshFilePath = '../samples/woody2_4.mesh.xml' mesh = yol.readOgreMeshFileAsMesh(meshFilePath, .01) print(mesh) print(mesh.getSubmeshFaceIndices('woody2_14_FOOT1')) print(mesh.getSubmeshVertexIndices('woody2_14_FOOT1')) print(mesh.getSubmeshVertexPositions('woody2_14_FOOT1')) positions = mesh.getSubmeshVertexPositions('woody2_14_FOOT1') viewer = ysv.SimpleViewer() viewer.record(False) viewer.doc.addRenderer('mesh', yr.MeshRenderer(mesh, (127,127,127))) viewer.doc.addObject('mesh', mesh) def extraDrawCallback(): for p in positions: ygh.drawPoint(p) viewer.setExtraDrawCallback(extraDrawCallback) viewer.startTimer(1/30.) viewer.show() Fl.run()
def test_Mesh(): meshFilePath = '../samples/physics2_woody_binding1.mesh.xml' mesh = yol.readOgreMeshFileAsMesh(meshFilePath) print(mesh)