I modify a plane geometry's vertices to create new geometry. But when I export the geometry it's still a plane geometry and my modified vertices is not included.
How do I export my new geometry as JSON including every changes?
Here's my code:
var seg = 5;
var dim = 70;
var zScale = 20;
var geometry = new THREE.PlaneGeometry(dim, dim, seg, seg );
var index = 0;
for (var gridY = 0; gridY < seg; gridY++) {
for (var gridX = 0; gridX < seg; gridX++) {
var z = Math.random() * zScale;
geometry.vertices[index].z = z;
index++;
}
}
geometry.elementsNeedUpdate = true;
geometry.verticesNeedUpdate = true;
var expJson = geometry.toJSON();
console.log(expJson);
My exported data looks like this:
{
height: 70
heightSegments: 5
metadata: {
generator: "Geometry.toJSON"
type: "PlaneGeometry"
},
version: 4.4
type: "PlaneGeometry"
uuid: "5F071B03-15EA-43CE-B4B3-4944E13D781C"
width: 70
widthSegments: 5
}