Skip to content

Instantly share code, notes, and snippets.

@edap
Created April 20, 2017 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edap/ed5dec4552489ace405bcc67fb8e43f7 to your computer and use it in GitHub Desktop.
Save edap/ed5dec4552489ace405bcc67fb8e43f7 to your computer and use it in GitHub Desktop.
load .ply files exported from magicavoxel into threejs
//THREE.PLYLoader returns a BufferGeometry
createMesh(buffGeometry){
let geometry = new THREE.Geometry().fromBufferGeometry( buffGeometry );
var material = new THREE.MeshPhongMaterial( { specular: 0x111111, shininess: 200, vertexColors: THREE.VertexColors } );
var mesh = new THREE.Mesh( geometry, material );
mesh.scale.multiplyScalar( 0.5 );
return mesh;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment