I would like to load custom model and taper its buffer geometry, how should I do it in the most efficient way in Three.js? I am also having hard time finding the correct algorithm for doing this type of modification on the object, is there some good resource for such non-linear transformations?
EDIT:
For example I am loading custom GLTF model and I am modifying its BufferGeometry as such:
function modify(geometry) {
var positionAttribute = geometry.attributes.position;
for (var i = 0; i < positionAttribute.count; i++) {
var x = positionAttribute.getX(i);
var y = positionAttribute.getY(i);
var z = positionAttribute.getZ(i);
z += Math.random() * 0.1;
positionAttribute.setXYZ(i, x, y, z);
}
}
And I would like the know if it is possible to taper my geometry with this approach and what is the best way to do it?