且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Three.js tile使用平面几何体具有多个纹理

更新时间:2023-01-04 20:03:15

我认为你必须看一下所谓的多物质对象。

I think you have to take a look at what is called a multi material object.

THREE.SceneUtils.createMultiMaterialObject( geometry, materials );

如果你谷歌那些你找到几个例子。像关于类似问题的答案

If you google for those you find several examples. Like this answer on a similar question.

或者查看 THREE.MeshFaceMaterial 。您可以使用它为同一几何体分配多种材质。

Or take a look at THREE.MeshFaceMaterial. You can use it to assign multiple materials for the same geometry.

var mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );

其中,材料是一系列材料,面部使用 materialIndex 获得指定正确材料的参数

Where materials is an array of materials and the faces use a materialIndex paramater to get appointed the right material

类似问题此处这里

这是一个小提琴,以证明它是可能的。我使用了其中一个链接的代码。

Here is a fiddle to demonstrate that it is possible. I used the code from one of the links.