i have a cylinder geometry that i'm trying to add waved surface to, i want it to look like this:
But after applying the code below, it looks very distorted like this:
second angle of my shape
I iterate all the vertices and apply sine to them like this:
STC.WarpControls.prototype.waves = function(){
var geometry = this.threeDHandler.threeD_meshes[0].geometry;
for (let i = 0; i < geometry.vertices.length; i++) {
geometry.vertices[i].y = Math.sin(( i + 0.00002)) *
(geometry.vertices[i].y);
}
geometry.verticesNeedUpdate = true;
}
does anyone know why my weird shape is happening? and how to apply a wavy shape to the cylinder? thanks for any help