How to taper geometry?

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?

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?

Could you elaborate a bit, what do you mean by “tapering” ? Randomizing z-position of each vertex :thinking: ? Shrinking?

When I say Tapering I mean this

In my addons Addon. Produces almost infinite many time-varying geometries with functions I have realized such deformations individually using different functions.

I made it for Geometry, indexed and non-indexed BufferGeometry.
Try it out:

Maybe you can take something from there.


line 1994, 2052

line 2075, 2158, 2221

see also
Modify indexed BufferGeometry (mouse or input)

1 Like

Do mean something like this?