Mesh transformation problem - flower petals

Hello,
I have a problem I’m trying to solve since a long time:

I generated a “flower” geometry (petals rotating around a pivot point)
and I am trying to make the petals close on mouse move. So it looks like a flower opening and closing.

(I know I can also generate it as instanced geom, but for now did just many meshes which I update in the render loop…)

Unfortunately I have no idea how to make the petals rotate in the right direction.

Below are two petals going up so you know what I mean (the solution is not right though), I just want all the petals going up.

Will be thankful for anyone who can help me or give me a hint how to solve it.

Link: https://jsfiddle.net/shpnn/6kx1evq2/11/

petals-threejs

It may be a bit easier if you move all rotation to the update function:

https://jsfiddle.net/rnjm012h/

Saves the hassle of reseting the transformations or calculating the local rotation by hand.

1 Like

Thanks a lot! That’s exactly what I needed.