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

Author Topic: Transformations not being applied to the points of the vectors  (Read 4894 times)

0 Members and 1 Guest are viewing this topic.

nick1702

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Transformations not being applied to the points of the vectors
« on: December 04, 2021, 09:51:31 pm »
Hi, I am trying to code a Hilbert Curve using SFML and am running into problems involving transformations. My thought was that if I made an object transformable, and made that object have a vector of vertexes inside of it, I could transform that object and the vector would be transformed however I am seeing that the transformations are applied to the object, but not the vector inside the object, so when I go to draw my vector the transformations are not applied. I must be missing something on how this works. How could I go about actually transforming the points within the vector easily so that they show up on the display? Thanks.

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: Transformations not being applied to the points of the vectors
« Reply #1 on: December 04, 2021, 10:26:45 pm »
You most likely want to use getTransform() (inherited from sf::Transformable) with your RenderStates used to draw the array:

https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php#creating-an-sfml-like-entity

 

anything