Hello! im trying to "deform" or "rig" a cylinder shape create in Processing and send it to vertex Shader:

here the piece of code that generate the shape:

Code cpp:int rr = 50; int h = 1000; int vertices = 25; beginShape(TRIANGLE_STRIP); for (int i = 0; i <= vertices; i++) { float angle = TWO_PI / vertices; float x = sin(i * angle); float z = cos(i * angle); float u = float(i) / vertices; vertex(x * rr, -h/2, z * rr); vertex(x * rr, +h/2, z * rr); } endShape();

here my default vertex:

Code glsl:#version 150 #define PROCESSING_COLOR_SHADER #ifdef GL_ES precision mediump float; #endif in vec4 position; in vec3 color; out vec3 Color; uniform mat4 transform; in vec2 texCoord; out vec2 TexCoord; in vec4 normal; uniform float u_time; uniform mat3 normalMatrix; void main() { vec4 pos = position; TexCoord = texCoord; Color = color; gl_Position = transform * pos; }

and here the result:

what i want is try to put the shape into some kind of "spline", or something like a ray, just something like that:

how can i "bend" geometry to generate that points of intersection? i assume is something that i can do in vertexShader, but maybe im wrong. thanks a lot