Created
April 20, 2017 12:05
-
-
Save edap/ed5dec4552489ace405bcc67fb8e43f7 to your computer and use it in GitHub Desktop.
load .ply files exported from magicavoxel into threejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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