Scaling along a non-cartesian axis #7850
-
I have a 2D mesh (for testing purposes, will most probably become a sprite eventually) that I want to "squish" along a vector that's not parallel to the X/Y axis, and changes at every time step. Outside of Bevy, rotate/scale/rotate back, but I'm not sure how to achieve this here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I believe this is only possible via parenting. Spawn the parent, and spawn the child as a "child" of parent. See this: https://answers.unity.com/questions/13436/how-to-scale-an-object-along-an-arbitrary-axis-in.html |
Beta Was this translation helpful? Give feedback.
I believe this is only possible via parenting.
So, make 2 entities: 1 parent, and 1 child with the 2D mesh.
Spawn the parent, and spawn the child as a "child" of parent.
Then, rotate the parent and scale the child accordingly.
Not super elegant, but possible.
This same restriction applies to Unity, I believe.
See this: https://answers.unity.com/questions/13436/how-to-scale-an-object-along-an-arbitrary-axis-in.html