Rotating multiple points at once in 2D
Posted
by
Deukalion
on Game Development
See other posts from Game Development
or by Deukalion
Published on 2012-10-25T10:20:14Z
Indexed on
2012/10/25
11:16 UTC
Read the original article
Hit count: 299
I currently have an editor that creates shapes out of (X, Y) coordinates and then triangulate that to make up a shape of those points.
What will I have to do to rotate all of those points simultaneously? Say I click the screen in my editor, it locates the point where I've clicked and if I move the mouse up or down from that point it calculates rotation on X and Y axis depending on new position relevant to first position, say I move up 10 on the Y axis it rotates that way and the same way for X. Or simply, somehow to enter rotation degree: 90, 180, 270, 360, for example.
I use VertexPositionColor at the moment.
What are the best algorithms or methods that I can look at to rotate multiple points in 2D at once?
Also:
Since this is an editor I do now want to rotate it on the Matrix, so if I want to rotate the whole shape 180 degree that's the new "position" of all the points, so that's the new rotation = 0 for example. Later on I probably will use World Matrix rotation for this, but not now.
© Game Development or respective owner