SFML community forums

Help => Graphics => Topic started by: battosaijenkins on April 04, 2021, 07:50:17 pm

Title: Possible shearing ?
Post by: battosaijenkins on April 04, 2021, 07:50:17 pm
Hello, if this question has been asked to death in the past then I apologize in advance but in the SFML documentation listed here:
https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Transform.php

In the detailed Description it says:
A sf::Transform specifies how to translate, rotate, scale, shear, project, whatever things.

I understand it has examples of translate, rotate, scale, and project but I haven't found any examples on shear?
I've even tried to check forums but I read somewhere that it wouldn't work since textures wouldn't be applied right and/or I would need to use in addition GLSL to do the shearing transformation is this true?
Title: Re: Possible shearing ?
Post by: Laurent on April 05, 2021, 09:22:55 am
It is possible, but SFML doesn't define any helper function for that, you'll have to build your sf::Transform from the 3x3 matrix directly.
See https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Transform.php#a78c48677712fcf41122d02f1301d71a3

Search "2D shear matrix" to know how to build one -- it's really simple.
Title: Re: Possible shearing ?
Post by: battosaijenkins on April 06, 2021, 07:05:42 pm
That's a good start. I'll check that out thx Laurent!