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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - PL_Andrev

Pages: [1]
1
Graphics / Rotation convex shape (ver 2.2).
« on: October 17, 2018, 03:41:02 pm »
Hello,

I'm trying to rotate convex shape (3 vertex) but without no success.
Code is build as:
x = 400;
y = 400;
sf::ConvexShape polygon;
polygon.setPointCount(3);
polygon.setPoint(0, sf::Vector2f(x, y);
polygon.setPoint(1, sf::Vector2f(x-5, y-5));
polygon.setPoint(2, sf::Vector2f(x+5, y-5));

Now if I'm trying rotate it (by 10 degs) shape is moving away from point (400,400).
I tried to use Origin function but didn't help.

Not sure what's wrong here,

Pages: [1]
anything