Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

How to rotate a line around a point?

$
0
0

I have tried everything around the internet and nothing worked. I'm pretty sure I am doing something stupidly wrong.

Basically, I have a line which is drawn (startX, startY, endX, endY) and I want to rotate it around the center (where the player's X and Y is).

Here's the image:

The little dot is the center

 

I actually have a triangle::

So I have three lines, each of them have their startX, startY, endX, endY coordinates.

I am trying to do it step by step, so how would I even rotate one line first?

 


Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>