I am utilizing the var shape = new THREE.Shape();
function. However, while using moveTo
and lineTo
, the diagram is not fully filled, and closePath()
does not complete the path after using lineTo
. Any insights into this issue would be appreciated.
Here is my code snippet:
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 squareShape = new THREE.Line(geometry, new THREE.LineBasicMaterial({
color: color
}));
return squareShape;