Which one is the best method to control a thin mesh?

Hi there

I have a model which is almost flat, like 250x250cm and just 5 cm height in average, and it has some other meshes parented to it on both sides, it’s not completely flat.

It’s rigid, not like a clothe, so I’ll not use physics. I would like to be able to completely bend it as I want, not just a curve but for example an s.

I’ve searched other examples and I didn’t like what I saw. Right now i have 2 ideas:
* Make a 2D matrix of bones and attach it.
* Access the vertexBuffer and modify there.

My goal is to make animations, so the CPU solution looks like not a good advice to me.

Thanks in advance.

So as not to give you suggestions you may have already researched what examples don’t you like?

Thanks for replying so fast.

My mesh is partially generated by code, so for example I can’t model it in in glb and just import it with the armature. I would like to see an example with armature not loaded from a glb or similar. Some examples I was checking yesterday:

Vertexbuffer with loops, too expensive:
https://www.babylonjs-playground.com/#VE6GP#2

Prerecorded animation:
https://www.babylonjs-playground.com/#3K859Y

Data from object, I don’t know how to make that data:
https://www.babylonjs-playground.com/#D4ZZ8#2

This mesh moves strange, and it’s loaded:
https://www.babylonjs-playground.com/#ZYTI53#3

Thanks for your time

Sorry but skeletons is one of many topics I know little about
I was thinking extrudeShape using instances for the animation

I see, thanks for the help.

I think the way to go is the bones, just lacking of a good example.

Agree on bones. You can attach bone data to your mesh and then control each bone individually
A lot of good examples:
https://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#rotating-positioning-and-scaling-bones

Demos are using an already prepared mesh but the idea is the same if you prepare it manually (You have to add matrix weights and indices to each vertex. Up to 4 bones can control each vertex)

Sorry, I missed your reply.

Thanks for your help

https://www.babylonjs-playground.com/#1AVEYO#56

Vertices-updating is “too expensive”? nahhh. :slight_smile:

We’re talking about a “ribbon” mesh, here, right? Or… a heightMap or displaceMap… like a ribbon whose bending is set by a gray-scale image. (as long as the “s”-shape doesn’t need to “bend back into itself”) (curl). HeightMaps/displaceMaps can’t back-bend concavianly. (fun word)

Ribbon. That’s the best way, me thinks.

Where am I? Why did I comment? I forget. Carry on. :slight_smile: