我使用var shape = new THREE.Shape();
。 moveTo
,lineTo
使用但不是完整填充图,而closePath()
不能使用lineTo
。请告诉答案。
这是我的代码。
var square = new THREE.Shape();
square.moveTo(startX, startY,0);
square.lineTo(endX, startY, 0);
square.lineTo(endX, endY, 0);
square.lineTo(startX, endY, 0);
square.lineTo(startX, startY,0);
var geometry = square.makeGeometry();
var square = new THREE.Line(geometry, new THREE.LineBasicMaterial({
color: color
}));
return square;
答案 0 :(得分:0)
我在makeGeometry
方法中使用不完全填充我的closePath。现在我查了我的代码var geometry = new THREE.BufferGeometry().setFromPoints(display.getPoints());
。这种类型正确地完全填充了我的图表。
var square = new THREE.Shape();
square.moveTo(startX, startY,0);
square.lineTo(endX, startY, 0);
square.lineTo(endX, endY, 0);
square.lineTo(startX, endY, 0);
square.lineTo(startX, startY,0); // closePath
var geometry = new THREE.BufferGeometry().setFromPoints(square.getPoints());
var square = new THREE.Line(geometry, new THREE.LineBasicMaterial({
color: color
}));
return square;