0

我正在尝试通过单击缩略图来更新我的天空盒纹理。

它基于这个例子:canvas_geometry_panorama.html


缩略图的标题与包含天空盒图像的文件夹匹配。因此,使用一个简单的 jQuery 脚本,它将生成一个指向该文件夹的链接:

$('.thumbs img').click(function() {
var myPath = 'img/' + $(this).attr("title") + '/';
});

接下来我在loadTexture中填写var:

var materials = [

                loadTexture(myPath+'lx.jpg'), // right
                loadTexture(myPath+'rx.jpg' ), // left
                loadTexture(myPath+'ly.jpg' ), // top
                loadTexture(myPath+'ry.jpg' ), // bottom
                loadTexture(myPath+'lz.jpg' ), // back
                loadTexture(myPath+'rz.jpg' )  // front

            ];

但它没有更新..为什么?

4

1 回答 1

0

https://github.com/mrdoob/three.js/wiki/Updates 这有帮助吗?:) 使用 material.needsUpdate = true;

于 2013-07-27T15:09:38.140 回答