SFML community forums

Help => Graphics => Topic started by: nick1702 on December 04, 2021, 09:51:31 pm

Title: Transformations not being applied to the points of the vectors
Post by: nick1702 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.
Title: Re: Transformations not being applied to the points of the vectors
Post by: fallahn 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