Update CylinderBufferGeometry

I created CylinderBufferGeometry with height of 10 .
now I changed height to 50 and update position attributes,

cylinde.geometry.attributes.position.needsUpdate = true;

but no change in position attributes.

is there anything else I have to do to update buffergeometry

How did you change its height? Via geometry’s parameters?

@prisoner849
yes.
Via geometry’s parameters

Read attentively the docs: https://threejs.org/docs/index.html#api/en/geometries/CylinderBufferGeometry.parameters :
Any modification after instantiation does not change the geometry

Maybe, it would be better to create a cylinder with height of 1 and then just use mesh.scale with setting the desired height?
Sort of: mesh.scale.y = 10; or mesh.scale.y = 50;, thus you don’t need to change your geometry.

Yes!
In that way I achieve what I want.

1 Like