Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Possible shearing ?  (Read 2405 times)

0 Members and 1 Guest are viewing this topic.

battosaijenkins

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Possible shearing ?
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Possible shearing ?
« Reply #1 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.
Laurent Gomila - SFML developer

battosaijenkins

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Re: Possible shearing ?
« Reply #2 on: April 06, 2021, 07:05:42 pm »
That's a good start. I'll check that out thx Laurent!

 

anything