PyOpenGL how do I import an obj file?

Set the keyword argument collect_faces = True, when you read the Wavefront .obj file. That causes that triangle face data are collected for every mesh.: (See PyWavefront) scene = pywavefront.Wavefront(‘Handgun_obj.obj’, collect_faces=True) Compute the scene box. The vertices are contained in scene.vertices. Each vertex is tuple with 3 components (x, y, z coordinate): scene_box = (scene.vertices[0], … Read more

Three.js Collada – What’s the proper way to dispose() and release memory (garbage collection)?

This should do the job: function disposeNode (node) { if (node instanceof THREE.Mesh) { if (node.geometry) { node.geometry.dispose (); } if (node.material) { if (node.material instanceof THREE.MeshFaceMaterial) { $.each (node.material.materials, function (idx, mtrl) { if (mtrl.map) mtrl.map.dispose (); if (mtrl.lightMap) mtrl.lightMap.dispose (); if (mtrl.bumpMap) mtrl.bumpMap.dispose (); if (mtrl.normalMap) mtrl.normalMap.dispose (); if (mtrl.specularMap) mtrl.specularMap.dispose (); if … Read more