I’m creating shapes for a table configurator using the Shape and ExtrudeGeometry and I want to change the dimensions of my table shapes but with the current logic I recreate the geometry shape the whole time and I notice with the r3f-perf monitor it feels a bit laggy and I also want to be able to animate when changing the dimensions of my table.
So my idea was changing the vertex position inside of the vertex shader.
I use the normal directions I’ve calculated for each vertex point by using the previous and next point and multiply it with the offset amount to reposition the point. But for other shapes than a rectangle it stretches the shape. The first image is when I tried changing the dimensions using the vertex shader
It should look like this, this is the logic where I recreate the geometry shape every time I change the value of the length.
Does anybody maybe know how I could solve this problem?
Here is also a link to the configurator with the current logic which creates a new geometry shape every time: https://table-showcase.vercel.app/
And here is also a link to my github repo: GitHub - Cheung-KaWai/table-showcase