Beginner question - twisting a mesh

Hello folks,
I’m totally new to three.js (my second day of learning so far), I wanna make a twisted box, in the form of a marshmallow.
I tried morph targets and also quaternions, didn’t succeed so far and not sure what I’m doing wrong.

Please check the pen below so you know what I’m talking about.
Can someone give me a hint how to achieve my goal?
I spent hours trying different approaches and don’t wanna give up yet

https://codepen.io/shinypanini/pen/VwwyZPj

Hi!
I would distort four cylinders :slight_smile:

1 Like

Something like this?

https://threejs.org/examples/#webgl_buffergeometry_morphtargets

2 Likes

When you’re get bored at work :innocent:

6 Likes

You could also generate each “fiber” by extrusion (THREE.ExtrudeBufferGeometry) a circular THREE.Shape along a helical THREE.Curve, and apply a rotation and color to each fiber. https://threejs.org/docs/#api/en/geometries/ExtrudeBufferGeometry

But @prisoner849’s solution is really great and even simpler.

2 Likes

Thank you all for the answers! @prisoner849’s example is exactly what I was looking for. Amazing, thanks a lot :slight_smile: