javascript - Three.js Update Texture image -
i'm using three.js create minecraft texture editor, similar this . i'm trying basic click-and-paint functionality down, can't seem figure out. have textures each face of each cube , apply them making shader materials following functions. this.createbodyshadertexture = function(part, update) { sides = ['left', 'right', 'top', 'bottom', 'front', 'back']; images = []; (i = 0; < sides.length; i++) { images[i] = 'img/'+part+'/'+sides[i]+'.png'; } texcube = new three.imageutils.loadtexturecube(images); texcube.magfilter = three.nearestfilter; texcube.minfilter = three.linearmipmaplinearfilter; if (update) { texcube.needsupdate = true; console.log(texcube); } return texcube; } this.createbodyshadermaterial = function(part, update) { shader = three.shaderlib['cube']; shader.uniforms['tcube'].value = this.c...