Hello,
I used a pretty long code to achieve what i wanted, meaning : being able to rotate, move AND expand an item made of vertices in any situation (whichever is value of the rotation angle).
I want first to explain the method i used, then i would like to ask hero members and non hero members, to show me how would they have achieved that with OTHER METHODS? Maybe some advanced methods/functions, or just different methods, i think discovering your methods for doing it might enlarge my understanding and offer a new view in programming, right now i just had to spend some with a paper and a pen to figure out how to achieve the expand item at any rotation angle, but i am pretty sure you guys know way faster methods to do it. So this is the purpose of this topic.
My method :
First of all, i made quad 4-vertices and made a function to rotate it.
sf::VertexArray CenterObj(sf::Quads,4);
CenterObj[0].position=sf::Vector2f(300,300);
CenterObj[1].position=sf::Vector2f(400,300);
CenterObj[2].position=sf::Vector2f(400,400);
CenterObj[3].position=sf::Vector2f(300,400);
(https://i.postimg.cc/dVfSZMXY/screenshot-136.png)
Then i made a function that would "expand" it (increase the size of the quad vertices overall), it depends on the angle of rotation, the global rotation angle is saved in a global variables called (save) which grows any time the rotate function is called.
ang=0;
save=ang;
..
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Q))
{
ang=4;
pivot(CenterObj,ang,4,CenterObj);
save=save+ang;
}
The rotation function (pivot) here is not important.
If the global rotation(save) is between 0 and 45, the expand function would behave in a certain manner, if the value of the global rotation (save) is between 45 and 90, it would behave in a different manner, same thing if it is between 90 and 135 and finally between 135 and 180. if save is above 179 it will go back to 0 (using "%"). So we have many areas.. many "zones"
Last observation, all this regions are reversed if the "save" is between 180 and 360.
float zone=save%180;
So in each case i will calculate 2 variables i call "differenceX" and "differenceY", and these 2 variables are the ones that are used to change the values of vertices. This image show them, the algorithm is just below the picture :
(https://i.postimg.cc/gJfWVS0w/screenshot-137.png)
void NewExpand(sf::VertexArray &V,float ExpandValue,char item,int NumberOfVertices)
{
//save=ang;
float zone=save%180;
// cout << "save : " << save << endl;
cout << " zone(real angle) : " << zone << endl;
if (V.getVertexCount()==4)
{
if(zone==0)
{
V[0].position.x=V[0].position.x-ExpandValue; V[0].position.y=V[0].position.y-ExpandValue;
V[1].position.x=V[1].position.x+ExpandValue; V[1].position.y=V[1].position.y-ExpandValue;
V[2].position.x=V[2].position.x+ExpandValue; V[2].position.y=V[2].position.y+ExpandValue;
V[3].position.x=V[3].position.x-ExpandValue; V[3].position.y=V[3].position.y+ExpandValue;
float test = V[0].position.x;
// cout << "value of of the quad vertices (case 0): " << test << " " << V[1].position.x << " " << V[2].position.x << " " << V[3].position.x << endl;
}
else if(zone>0&&zone<45){ Angle2=45-save; /// /zone A
float PivotedSideRectangle = sqrt((V[1].position.y-V[0].position.y)*(V[1].position.y-V[0].position.y) + (V[1].position.x-V[0].position.x)*(V[1].position.x-V[0].position.x)) ;
OldHypotenuse=COS(45)*PivotedSideRectangle;
float NewHypotenuse=OldHypotenuse+ExpandValue;
// float ExpandedSideNewRect=NewHypotenuse/COS(45); //Idk if this is useful
float NewY=NewHypotenuse*COS(Angle2); // It's Y on the window eventhouth cosinus
float NewX=NewHypotenuse*SIN(Angle2);
float Ypart1=COS(Angle2)*OldHypotenuse;
float Xpart1=SIN(Angle2)*OldHypotenuse;
float differenceY=abs(NewY-Ypart1);
float differenceX=abs(NewX-Xpart1);
if(save%360>=180)
{
V[0].position.x=V[0].position.x+differenceX;
V[0].position.y=V[0].position.y+differenceY;
///
V[1].position.x=V[1].position.x-differenceY;
V[1].position.y=V[1].position.y+differenceX;
///
V[2].position.x=V[2].position.x-differenceX;
V[2].position.y=V[2].position.y-differenceY;
///
V[3].position.x=V[3].position.x+differenceY;
V[3].position.y=V[3].position.y-differenceX;
}
else{
V[0].position.x=V[0].position.x-differenceX;
V[0].position.y=V[0].position.y-differenceY;
///
V[1].position.x=V[1].position.x+differenceY;
V[1].position.y=V[1].position.y-differenceX;
///
V[2].position.x=V[2].position.x+differenceX;
V[2].position.y=V[2].position.y+differenceY;
///
V[3].position.x=V[3].position.x-differenceY;
V[3].position.y=V[3].position.y+differenceX;
}
// cout << "value of of the quad vertices (case <45) : " << V[0].position.x << " " << V[1].position.x << " " << V[2].position.x << " " << V[3].position.x << endl;
}
else if(zone==45)
{
if(save%360>=180)
{
V[0].position.y=V[0].position.y+ExpandValue;
V[1].position.x=V[1].position.x-ExpandValue;
V[2].position.y=V[2].position.y-ExpandValue;
V[3].position.x=V[3].position.x+ExpandValue;
}
else
{
V[0].position.y=V[0].position.y-ExpandValue;
V[1].position.x=V[1].position.x+ExpandValue;
V[2].position.y=V[2].position.y+ExpandValue;
V[3].position.x=V[3].position.x-ExpandValue;
}}
else if(zone>45&&zone<90) /// Zone A2
{Angle2=save-45;
double PivotedSideRectangle = sqrt((V[1].position.y-V[0].position.y)*(V[1].position.y-V[0].position.y) + (V[1].position.x-V[0].position.x)*(V[1].position.x-V[0].position.x)) ;
OldHypotenuse=COS(45)*PivotedSideRectangle;
float NewHypotenuse=OldHypotenuse+ExpandValue;
float NewY=NewHypotenuse*COS(Angle2); // It's Y on the window eventhouth cosinus
float NewX=NewHypotenuse*SIN(Angle2);
float Ypart1=COS(Angle2)*OldHypotenuse;
float Xpart1=SIN(Angle2)*OldHypotenuse;
double differenceY=abs(NewY-Ypart1);
double differenceX=abs(NewX-Xpart1);
// cout << PivotedSideRectangle << endl;
// cout << OldHypotenuse << endl;
if(save%360>=180)
{
V[0].position.x=V[0].position.x-differenceX;
V[0].position.y=V[0].position.y+differenceY;
///
V[1].position.x=V[1].position.x-differenceY;
V[1].position.y=V[1].position.y-differenceX;
///
V[2].position.x=V[2].position.x+differenceX;
V[2].position.y=V[2].position.y-differenceY;
///
V[3].position.x=V[3].position.x+differenceY;
V[3].position.y=V[3].position.y+differenceX;
}
else
{
V[0].position.x=V[0].position.x+differenceX;
V[0].position.y=V[0].position.y-differenceY;
///
V[1].position.x=V[1].position.x+differenceY;
V[1].position.y=V[1].position.y+differenceX;
///
V[2].position.x=V[2].position.x-differenceX;
V[2].position.y=V[2].position.y+differenceY;
///
V[3].position.x=V[3].position.x-differenceY;
V[3].position.y=V[3].position.y-differenceX;
// cout << "value of of the quad vertices (Case under 90) : " << V[0].position.x << " " << V[1].position.x << " " << V[2].position.x << " " << V[3].position.x << endl;
// cout << "value of of the quad vertices.Y (Case under 90) : " << V[0].position.y << " " << V[1].position.y << " " << V[2].position.y << " " << V[3].position.y << endl;
}}
else if(zone==90)
{
if(save%360>=180)
{
V[0].position.x=V[0].position.x-ExpandValue;
V[1].position.y=V[1].position.y-ExpandValue;
V[2].position.x=V[2].position.x+ExpandValue;
V[3].position.y=V[3].position.y+ExpandValue;
}
else
{
V[0].position.x=V[0].position.x+ExpandValue;
V[1].position.y=V[1].position.y+ExpandValue;
V[2].position.x=V[2].position.x-ExpandValue;
V[3].position.y=V[3].position.y-ExpandValue;
}}
else if(zone>90&&zone<135)
{Angle2=90+45-save; /// //Zone B
double PivotedSideRectangle = sqrt((V[1].position.y-V[2].position.y)*(V[1].position.y-V[2].position.y) + (V[1].position.x-V[2].position.x)*(V[1].position.x-V[2].position.x)) ;
OldHypotenuse=COS(45)*PivotedSideRectangle;
float NewHypotenuse=OldHypotenuse+ExpandValue;
float ExpandedSideNewRect=NewHypotenuse/COS(45); //Idk if this is useful
float NewY=NewHypotenuse*COS(Angle2); // It's Y on the window eventhouth cosinus
float NewX=NewHypotenuse*SIN(Angle2);
float Ypart1=COS(Angle2)*OldHypotenuse;
float Xpart1=SIN(Angle2)*OldHypotenuse;
float differenceY=abs(NewY-Ypart1);
float differenceX=abs(NewX-Xpart1);
// cout << "angle2 :" << Angle2 << endl;
if(save%360>=180)
{
V[2].position.x=V[2].position.x+differenceY;
V[2].position.y=V[2].position.y-differenceX;
V[3].position.x=V[3].position.x+differenceX;
V[3].position.y=V[3].position.y+differenceY;
V[0].position.x=V[0].position.x-differenceY;
V[0].position.y=V[0].position.y+differenceX;
V[1].position.x=V[1].position.x-differenceX;
V[1].position.y=V[1].position.y-differenceY;
}
else
{
V[2].position.x=V[2].position.x-differenceY;
V[2].position.y=V[2].position.y+differenceX;
V[3].position.x=V[3].position.x-differenceX;
V[3].position.y=V[3].position.y-differenceY;
V[0].position.x=V[0].position.x+differenceY;
V[0].position.y=V[0].position.y-differenceX;
V[1].position.x=V[1].position.x+differenceX;
V[1].position.y=V[1].position.y+differenceY;
// cout << "value of of the quad vertices (Case under 135) : " << V[0].position.x << " " << V[1].position.x << " " << V[2].position.x << " " << V[3].position.x << endl;
// cout << "value of of the quad vertices.Y (Case under 135) : " << V[0].position.y << " " << V[1].position.y << " " << V[2].position.y << " " << V[3].position.y << endl;
}}
else if(zone==135)
{
if(save%360>=180)
{
V[0].position.y=V[0].position.y-ExpandValue;
V[1].position.x=V[1].position.x+ExpandValue;
V[2].position.y=V[2].position.y+ExpandValue;
V[3].position.x=V[3].position.x-ExpandValue;
}
else
{
V[0].position.y=V[0].position.y+ExpandValue;
V[1].position.x=V[1].position.x-ExpandValue;
V[2].position.y=V[2].position.y-ExpandValue;
V[3].position.x=V[3].position.x+ExpandValue;
}}
else if(zone>135&&zone<180){Angle2=save-(45+90);
float PivotedSideRectangle = sqrt((V[1].position.y-V[0].position.y)*(V[1].position.y-V[0].position.y) + (V[1].position.x-V[0].position.x)*(V[1].position.x-V[0].position.x)) ;
OldHypotenuse=COS(45)*PivotedSideRectangle;
float NewHypotenuse=OldHypotenuse+ExpandValue;
float NewY=NewHypotenuse*COS(Angle2); // It's Y on the window eventhouth cosinus
float NewX=NewHypotenuse*SIN(Angle2);
float Ypart1=COS(Angle2)*OldHypotenuse;
float Xpart1=SIN(Angle2)*OldHypotenuse;
float differenceY=abs(NewY-Ypart1);
float differenceX=abs(NewX-Xpart1);
if(save%360>=180)
{
V[2].position.x=V[2].position.x+differenceY;
V[2].position.y=V[2].position.y+differenceX;
V[3].position.x=V[3].position.x-differenceX;
V[3].position.y=V[3].position.y+differenceY;
V[0].position.x=V[0].position.x-differenceY;
V[0].position.y=V[0].position.y-differenceX;
V[1].position.x=V[1].position.x+differenceX;
V[1].position.y=V[1].position.y-differenceY;}
else {
V[2].position.x=V[2].position.x-differenceY;
V[2].position.y=V[2].position.y-differenceX;
V[3].position.x=V[3].position.x+differenceX;
V[3].position.y=V[3].position.y-differenceY;
V[0].position.x=V[0].position.x+differenceY;
V[0].position.y=V[0].position.y+differenceX;
V[1].position.x=V[1].position.x-differenceX;
V[1].position.y=V[1].position.y+differenceY;
// cout << "value of of the quad vertices (Case under 180) : " << V[0].position.x << " " << V[1].position.x << " " << V[2].position.x << " " << V[3].position.x << endl;
// cout << "value of of the quad vertices.Y (Case under 180) : " << V[0].position.y << " " << V[1].position.y << " " << V[2].position.y << " " << V[3].position.y << endl;
}
}
} /// end of : if (V.getVertexCount()==4)
} /// end of function
Inside the main, i will call the rotate function "pivot" and check the value of angle, so at each zone i will test the 'NewExpand" function and see if it works. (as shown in the second code of this post, using the letter "Q", check above). Well it does! :)
I am proud to have achieved it. Now i would be happy to see how you do it guys? I have no doubt there are much better and faster and more powerful methods to associate an expand function with a rotate and a movement one for a groupe of vertices or other, with a result expeceted similar to this one :
https://gfycat.com/poisedthinhartebeest
Yes indeed, it was really fun to rewrite everything on paper and try hard to find the relation between all the available angles and finally be able to find how to expand the shape.. the way i wanted.
It was also.. painful, painfully good but painful, because it takes some time.
The irony here, is that this is the only way i know of, that achieves this result, and i was hoping by writing all of this, that someone would be encouraged enough to show me how it is done with "sf::Transformable or sf::Transform" as you say.
I don't wish to continue like that for future crazy interactions i plan for my entities on my future projects, i must learn the way you do it.
I would like to see just an example using my quad vertices :
sf::VertexArray CenterObj(sf::Quads,4);
CenterObj[0].position=sf::Vector2f(300,300);
CenterObj[1].position=sf::Vector2f(400,300);
CenterObj[2].position=sf::Vector2f(400,400);
CenterObj[3].position=sf::Vector2f(300,400);
( this is the same one from the OP)
And see :
1) How would you inherit it from transformable class.
2) How would you rotate it ... around its center or around any point of the window (not interested in the classical rotation around upper left point of an "item")
3) how to scale it....
___
While i am writing this, and by thinking about what you wrote yesterday, an idea popped in my head, maybe i understood what you meant :
so you guys make vertices shape, put it on a "sprite" and then only after that, you would apply the transform on the item resulted?
I'd rather see an example, i am pretty sure it's easy as cake for you other hero members. I kinda saturated my mind a bit briefly.
Ok so i tried to inherit a class from the "drawable" and "transformable" classes, i named : VertexClass
class VertexClass : public sf::Drawable, public sf::Transformable
{
private:
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const {
states.transform *= getTransform();
states.texture = &m_tileset;
target.draw(m_vertices, states);
}
sf::VertexArray m_vertices; // https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1VertexArray.php
sf::Texture m_tileset;
public:
bool construction()
{
m_vertices.setPrimitiveType(sf::Quads);
sf::Vertex* quad = &m_vertices[0];
// define its 4 corners
quad[0].position = sf::Vector2f(100,100);
quad[1].position = sf::Vector2f(150,100);
quad[2].position = sf::Vector2f(150,150);
quad[3].position = sf::Vector2f(100,150);
quad[0].color = sf::Color::Red;
quad[1].color = sf::Color::Yellow;
quad[2].color = sf::Color::Black;
quad[3].color = sf::Color::Blue;
return true;
}
};
Just for the sake of experimentation, i did not try any rotation or transformation, i just wanted to test the draw function, following the TILEMAP example,
int main()
{
sf::ContextSettings contextSettings;
contextSettings.depthBits = 24;
contextSettings.stencilBits = 8;
contextSettings.antialiasingLevel = 0;
contextSettings.majorVersion = 3;
contextSettings.minorVersion = 3;
sf::RenderWindow window(sf::VideoMode(width, height), "It Works!", sf::Style::Close, contextSettings);
window.setFramerateLimit(30);
VertexClass VC; // class
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear(sf::Color::Black);
window.draw(VC);
window.display();
}
return 0;
}
I get a black screen. Why is that?
Thanks for all the help, i have finally done it.
Here is vertex class :
class VertexFun : public sf::Drawable, public sf::Transformable
{
private:
sf::VertexArray V;
sf::Texture Tex;
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const {
states.transform *= getTransform();
// apply the tileset texture
states.texture = &Tex;
//states.texture = nullptr;
// draw the vertex array
target.draw(V, states);
}
public:
bool VertexShapeContruction3(const std::string& address,sf::Vector2f v0,sf::Vector2f v1,sf::Vector2f v2 )
{
if (!Tex.loadFromFile(address)) // load the tileset texture
{return false;}
V.setPrimitiveType(sf::Triangles);
V.resize(3);
sf::Vertex* quad = &V[0];
// define its 4 corners
quad[0].position = v0;
quad[1].position = v1;
quad[2].position = v2;
quad[0].texCoords = v0;
quad[1].texCoords = v1;
quad[2].texCoords = v2;
// sf::Vertex vertexTab[4] = /// METHODE 3 (Tab)
// {
// sf::Vertex(sf::Vector2f(400,400),sf::Color::Black),
// sf::Vertex(sf::Vector2f(460,450),sf::Color::Yellow),
// sf::Vertex(sf::Vector2f(460,500),sf::Color::Blue),
// sf::Vertex(sf::Vector2f(400,400),sf::Color::Red)
// };
return true;
}
bool VertexShapeContruction4(const std::string& address,sf::Vector2f v0,sf::Vector2f v1,sf::Vector2f v2,sf::Vector2f v3 )
{
if (!Tex.loadFromFile(address)) // load the tileset texture
{return false;}
V.setPrimitiveType(sf::Quads);
V.resize(4);
sf::Vertex* quad = &V[0];
quad[0].position = v0;
quad[1].position = v1;
quad[2].position = v2;
quad[3].position = v3;
quad[0].texCoords = v0;
quad[1].texCoords = v1;
quad[2].texCoords = v2;
quad[3].texCoords = v3;
return true;
}
};
And here is the the use of it :
VertexFun vertexFun1,vertexFun2,vertexFun3,vertexFun4,vertexFun5;
vertexFun1.VertexShapeContruction3("data/Thing.png",sf::Vector2f(100,9),sf::Vector2f(123,75),sf::Vector2f(78,75));
vertexFun2.VertexShapeContruction3("data/Thing.png",sf::Vector2f(190,97),sf::Vector2f(123,122),sf::Vector2f(123,75));
vertexFun3.VertexShapeContruction3("data/Thing.png",sf::Vector2f(100,186),sf::Vector2f(78,122),sf::Vector2f(123,122));
vertexFun4.VertexShapeContruction3("data/Thing.png",sf::Vector2f(11,97),sf::Vector2f(78,122),sf::Vector2f(78,75));
vertexFun5.VertexShapeContruction4("data/Thing.png",sf::Vector2f(123,122),sf::Vector2f(123,75),sf::Vector2f(78,75),sf::Vector2f(78,122));
///
sf::Transform tr;
vertexFun1.setPosition(100,100); // 100/100 is the center of the original "thing" texture?
vertexFun2.setPosition(100,100);
vertexFun3.setPosition(100,100);
vertexFun4.setPosition(100,100);
vertexFun5.setPosition(100,100);
vertexFun1.setOrigin(100,100);
vertexFun2.setOrigin(100,100);
vertexFun3.setOrigin(100,100);
vertexFun4.setOrigin(100,100);
vertexFun5.setOrigin(100,100);
float scl=1;
bool rot=0,lef=0,rig=0,up=0,dow=0,ex=0,con=0;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed||event.key.code == sf::Keyboard::Escape)
window.close();
if (sf::Keyboard::isKeyPressed(sf::Keyboard::R)) ///
{rot=1;}
if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::R)
{rot=0;}
if(event.type == sf::Event::MouseButtonPressed && event.mouseButton.button == sf::Mouse::Left)
{
cout << " The coordinates : " << sf::Mouse::getPosition(window).x << " " << sf::Mouse::getPosition(window).y << endl;
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) ///
{rig=1;}
if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::Right)
{rig=0;}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) ///
{lef=1;}
if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::Left)
{lef=0;}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) ///
{up=1;}
if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::Up)
{up=0;}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) ///
{dow=1;}
if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::Down)
{dow=0;}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::E)) ///
{ex=1;}
if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::E)
{ex=0;}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::C)) ///
{con=1;}
if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::C)
{con=0;}
}
if(rot==1)
{
vertexFun5.rotate(15);
vertexFun4.rotate(15);
vertexFun3.rotate(15);
vertexFun2.rotate(15);
vertexFun1.rotate(15);
}
if(rig==1)
{
vertexFun5.move(sf::Vector2f(10,0));
vertexFun4.move(10,0);
vertexFun3.move(10,0);
vertexFun2.move(10,0);
vertexFun1.move(10,0);
}
if(rig==1)
{
vertexFun5.move(sf::Vector2f(10,0));
vertexFun4.move(10,0);
vertexFun3.move(10,0);
vertexFun2.move(10,0);
vertexFun1.move(10,0);
}
if(lef==1)
{
vertexFun5.move(sf::Vector2f(-10,0));
vertexFun4.move(-10,0);
vertexFun3.move(-10,0);
vertexFun2.move(-10,0);
vertexFun1.move(-10,0);
}
if(up==1)
{
vertexFun5.move(sf::Vector2f(0,-10));
vertexFun4.move(0,-10);
vertexFun3.move(0,-10);
vertexFun2.move(0,-10);
vertexFun1.move(0,-10);
}
if(dow==1)
{
vertexFun5.move(sf::Vector2f(0,10));
vertexFun4.move(0,10);
vertexFun3.move(0,10);
vertexFun2.move(0,10);
vertexFun1.move(0,10);
}
if(ex==1)
{
if(scl<=1.5)
{
scl=scl+0.1;
vertexFun5.setScale(scl,scl);
vertexFun4.setScale(scl,scl);
vertexFun3.setScale(scl,scl);
vertexFun2.setScale(scl,scl);
vertexFun1.setScale(scl,scl);
cout << " current scale : " << scl << endl;
}
}
if(con==1)
{
if(scl>=0.1)
{
scl=scl-0.1;
vertexFun5.setScale(scl,scl);
vertexFun4.setScale(scl,scl);
vertexFun3.setScale(scl,scl);
vertexFun2.setScale(scl,scl);
vertexFun1.setScale(scl,scl);
cout << " current scale : " << scl << endl;
}
}
window.clear(sf::Color::White);
window.draw(vertexFun1);
window.draw(vertexFun2);
window.draw(vertexFun3);
window.draw(vertexFun4);
window.draw(vertexFun5);
window.display();
}
I can finally do what i wanted from the beginning.
Be able to rotate/scale/move a vertex shape any way i want. Here is my feedback :
__________
1) I feel i have been disoriented by 2 things since the beginning :
A) https://en.sfml-dev.org/forums/index.php?topic=26984.0 in this post someone suggested me to use the matrix :
[cos(A) -sin(A)]
[sin(A) cos(A)]
And then i continued here https://en.sfml-dev.org/forums/index.php?topic=27070.0
And nobody told to not bother with this kind of matrix to focus on the transformable inhertence possibility, at that moment.
B) Why is the Vertex class, not a transformable from the beginning ??
2) Is it mondatory to have the inheritence from the Drawable class first :
class VertexFun : public sf::Drawable, public sf::Transformable
I am asking because this form
class VertexFun : public sf::Transformable, public sf::Drawable
Gave me an error message.
3) The gap between the skills required to "ingurgitate" the first first 80% part from the tutorial on transformations is huge between it and and the last examples (Tilemap example). I mean inside that example, there are "resize" functions that a 2 month C++ newcomer would not expect to be part of C++ and not part of the class transformable, also there are useless variables such as the "tv" variable, etc..
Maybe put a simpler example, more graduate.
4) While reading the transformation tutorial : https://www.sfml-dev.org/tutorials/2.5/graphics-transform.php
I read :
To keep things simple, there's only a single origin for all three transformation components. This means that you can't position an entity relative to its top-left corner while rotating it around its center for example. If you need to do such things, have a look at the next chapters.
I looked inside this chapter and inside the following tutorials, i could find it and still don't. I figured out how it works thogh (i think).
Trying to give a constructive feedback ofcourse, i respect a lot this whole work that has beed done and i,..myself would never be able to bring ou such an awesome website/tool/tutorial(s) to the world (right now).
So thanks again for the great tool that SFML is, and thanks for the help.