I'm struggling to create a polygon in a 3D space using Three.js. The resources I've found so far are not helpful for my specific needs.
Here are the coordinates of the polygon I want to draw:
( x, y, z )
P1: (-200, -200, -200)
P2: ( 200, 200, 200)
P3: ( 150, -150, 150)
P4: (-200, -200, -200)
The "z" coordinate value is always coming out as zero, which is not what I want.
var points = [];
points.push(new THREE.Vector3(-200, -200, -200));
points.push(new THREE.Vector3(200, 200, 200));
points.push(new THREE.Vector3(150, -150, 150));
points.push(new THREE.Vector3(-200, -200, -200));
var squareShape = new THREE.Shape( points );
var geometry = new THREE.ShapeGeometry( squareShape );
var material = new THREE.MeshBasicMaterial( { color: 0x357fff } );
var poligon = new THREE.Mesh( geometry, material );
scene.add(poligon);
If anyone has any insights or solutions, I would greatly appreciate the help.