Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Rotation of a sprite
Print
Pages: [
1
]
Author
Topic: Rotation of a sprite (Read 1503 times)
0 Members and 1 Guest are viewing this topic.
SamuelGHOST
Newbie
Posts: 5
Rotation of a sprite
«
on:
November 24, 2018, 06:56:59 pm »
Let's say that I have current and next coordinations of a sprite. How do I rotate sprite towards the position of the next coordinations?
Logged
ZeroZ30o
Newbie
Posts: 47
Re: Rotation of a sprite
«
Reply #1 on:
November 24, 2018, 07:43:34 pm »
A rotation does not change the position (coordinates) of a sprite's center of rotation (which is what you actually "move"), so I don't know what you mean.
Logged
NGM88
Full Member
Posts: 162
Re: Rotation of a sprite
«
Reply #2 on:
November 25, 2018, 09:47:30 am »
With MATH
. Calculate the angle using std::atan2().
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Rotation of a sprite