Is it possible to create (or emulate) shear transformations? #14622
-
I am trying to render 3D objects from an old game's world in Bevy. The vast majority of them have SRT (scale/rotation/translation) transformation matrices, but some of them also contain shearing. Bevy's Rendering sheared objects without the shear causes them to look out of place, so I'm wondering if there's any "accepted" way of handling this (I certainly haven't found one); even if there isn't a consensus, any suggestions are welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, |
Beta Was this translation helpful? Give feedback.
Yes,
Transform
doesn't have shear, it's rare feature, and looks like it some sort of combination of scale and rotation, you can try to calculate affine matrix by rotating till your objects diagonal would be located on one of axes, than scale (i think increasing) by that axis and rotate back. Matrix containing all that operations would be shearing matrix. Or if I'm wrong you could try to make your own shearing vertex shader with same idea in mind.