0

更新:我制作了 jsfiddle 示例 - jsfiddle.net/NEXny/1/

[ignore this - just including a code block so stackoverflow will

让我发布上面的 JSFiddle 链接。是的,认真的。]

我无法将纹理应用于 RingGeometry 和 CylinderGeometry,希望这张图片能解释我的问题。

质地

可以通过其中一种方式应用纹理吗?目前我得到了非常意想不到的结果......

4

1 回答 1

3

您必须根据自己的喜好修改几何顶点 UV。

相反,为什么不只CircleGeometry用于您的气缸端盖。也就是说,自己构建端盖?

// cylinder
geometry = new THREE.CylinderGeometry( 192, 192, 40, 64, 1, true ); // open-ended
geometry1 = new THREE.CircleGeometry(192, 64);

// end-cap material
material1 = new THREE.MeshBasicMaterial({ 
    map: textures.circle,
    overdraw: 0.5 // for canvas renderer only
});

// cylinder material
material = new THREE.MeshBasicMaterial({ 
    map: textures.line,
    overdraw: 0.5 // for canvas renderer only
});

object = new THREE.Object3D();
scene.add(object);

// end-caps
var mesh1 = new THREE.Mesh(geometry1, material1);
mesh1.rotation.x = - Math.PI / 2;
mesh1.position.y = 20
object.add(mesh1);

var mesh2 = new THREE.Mesh(geometry1, material1);
mesh2.rotation.x = Math.PI / 2;
mesh2.position.y = -20
object.add(mesh2);

// cylinder
var mesh = new THREE.Mesh(geometry, material);
object.add(mesh);

小提琴:http: //jsfiddle.net/NEXny/2/

三.js r.61

于 2013-09-19T16:44:50.797 回答