问题描述
我正在制作像 krpano 这样的全景图.我想知道如何使用小图像作为一个立方体面的纹理?http://stemkoski.github.io/Three.js/Skybox.html这个例子使用了 6 张图片作为立方体的纹理.我可以使用许多小块作为立方体面的每个纹理吗?
I am making a panorama like krpano.I want to know how can i use small images as a texture of one cube face?http://stemkoski.github.io/Three.js/Skybox.htmlThis example uses 6 pics as texture of cube.Could i use many small tiles as each texture of cube face?
推荐答案
我认为答案是创建一个新几何体,设置您自己的顶点,满足您需求的面,然后设置 faceVertexUvs 和 materialIndex 以使其具有良好的纹理.
I think the answer is making a new geometry,set your own vertices,faces that meet your demand and then set the faceVertexUvs and materialIndex to make it well textured.
vertices.forEach(function(v){
geom.vertices.push(new THREE.Vector3(v[0],v[1],v[2]));});
faces.forEach(function(v){
geom.faces.push( new THREE.Face3( v[0],v[1],v[2] ) );});
我这里有一个例子:multipleTexture
还要注意
使用边是 2 的幂的纹理是理想的-webgl 纹理
这篇关于我如何在three.js中使用无重复平铺纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!