我在THREE.ExtrudeGeometry中绘制画布纹理时遇到问题。 以下图片是我想要的
但它似乎运作不佳。它看起来像一个黑色的场景 这是我的项目场景。纹理对于离开PlaneGeometry很好,但是对于正确的ExtrudeGeometry没有用。
var shape = new THREE.Shape(points);
var extrudeSettings = {
size: 1,
amount: 8,
bevelEnabled: false,
material: 0,
extrudeMaterial: 1
};
var geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
var canvas = document.querySelector('.heatmap-canvas');
var texture = new THREE.Texture(canvas);
texture.needsUpdate = true;
texture.minFilter = THREE.LinearFilter;
var material = new THREE.MeshLambertMaterial({
map: texture,
color: 0xffffff,
transparent: true,
opacity: 0.7
});
var mesh = new THREE.Mesh(geometry, material);