答:是的,它绝对可以是单个图像。您在提供的 stackoverflow 问题中有证据。
为什么存在交叉图像:有时(我在 OpenGl 中做过),您可以在图像中为立方体的 6 个面中的每一个指定坐标。看起来three.js 库不提供此功能。
他们提供的是 .repeat 和 .offset 属性。这就是单图像 jsfiddle 中使用的内容。
for ( var i = 0; i < 6; i ++ ) {
t[i] = THREE.ImageUtils.loadTexture( imgData ); //2048x256
t[i].repeat.x = 1 / 8;
t[i].offset.x = i / 8;
// Could also use repeat.y and offset.y, which are probably used in the 2x3 image
....
您可以尝试使用小提琴来查看如果修改这些值会发生什么。IE
t[i].repeat.x = 1 / 4;
t[i].offset.x = i / 4;
祝你好运,希望这有帮助。
奖金问题编辑:此外,在THREE.CubeTextureLoader().load()代码中,它实际上会在加载 6 张图像后自动更新:
...
if ( loaded === 6 ) {
texture.needsUpdate = true;
if ( onLoad ) onLoad( texture );
}