Given a JSON with base coordinates, I am looking to generate a cube in Three.js. The height of the cube will be a constant value, such as 1.
{
"points": [
{
"x": 0,
"y": 0,
"z": 0
},
{
"x": 0,
"y": -1,
"z": 0
},
{
"x": 1,
"y": 0,
"z": 0
},
{
"x": 1,
"y": -1,
"z": 0
}
]
}
What type of geometry should be used in Three.js for this task?
I attempted to use ExtrudeGeometry, but encountered issues with missing top and incorrect base coordinates in the rendered cube.