将现有的THREE.js材质转换为CubeTexture以用作envMap

时间:2019-01-24 12:21:47

标签: javascript three.js

是否可以将现有材料转换为CubeTexture?我想稍后将其用于GLTF模型的envMap。我知道有一个CubicTextureLoader,但我想使用现有的材料。

var testMateri1 = new THREE.MeshBasicMaterial( {map: new THREE.TextureLoader(ladeManager).load('textures/face-r.jpg')} );
var testMateri2 = new THREE.MeshBasicMaterial( {map: new THREE.TextureLoader(ladeManager).load('textures/face-l.jpg')} );
var testMateri3 = new THREE.MeshBasicMaterial( {map: new THREE.TextureLoader(ladeManager).load('textures/face-t.jpg')} );
var testMateri4 = new THREE.MeshBasicMaterial( {map: new THREE.TextureLoader(ladeManager).load('textures/face-d.jpg')} );
var testMateri5 = new THREE.MeshBasicMaterial( {map: new THREE.TextureLoader(ladeManager).load('textures/face-f.jpg')} );
var testMateri6 = new THREE.MeshBasicMaterial( {map: new THREE.TextureLoader(ladeManager).load('textures/face-b.jpg')} );
var meinEnvMap = new THREE.CubeTexture( [testMateri1, testMateri2, testMateri3, testMateri4, testMateri5, testMateri6 ]);

0 个答案:

没有答案