Hello!
I am having trouble drawing an Arrow, mainly with the triangle.
This code draws a line and a Triangle between any two points, but the Triangle does not have the correct orientation (it is always the same). I thought that by rotating the Triangle it would fix this, but the rotation is not in place but about the origin.
sf::Shape Line = sf::Shape::Line(x1,y1,x2,y2,1,sf::Color::White);
sf::Shape Triangle;
float angle = 2 * PI/3;
float angle_rect = PI/2;
float d = 50;
for (int i = 0; i < 3; i++) {
Triangle.AddPoint(x2+d*sin(angle*i), y2+d*cos(angle*i), sf::Color::White);
}
App.Draw(Line);
sf::Vector2f av =Triangle.GetPosition();
App.Draw(Triangle);
(NOTE: this code does not have the rotation in it)
Any advice?