mrdoob/three.js — Issue #997: Possible to split texture in multiple textures?
Author: robin0van0der0v
Created: 2012-01-01 17:36:30+00:00
State: open

Hello again.

I found out how to apply a texture to a cube instead of random colors.
I use this piece of code:

var headTextures = new Array();
headTextures[0] = new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture("right.png")}); //http://robin-test.tk/test/right.png
headTextures[1] = new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture("left.png")}); //http://robin-test.tk/test/left.png
headTextures[2] = new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture("top.png")}); //http://robin-test.tk/test/top.png
headTextures[3] = new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture("bottom.png")}); //http://robin-test.tk/test/bottom.png
headTextures[4] = new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture("front.png")}); //http://robin-test.tk/test/front.png
headTextures[5] = new THREE.MeshBasicMaterial({map: THREE.ImageUtils.loadTexture("back.png")}); //http://robin-test.tk/test/back.png

But can I also use one single image (like this: http://robin-test.tk/test/texture.png) and split it into 6 textures?

~ Robin.