1
vote
1answer
93 views

JavaScript: Rotating a canvas around its center for a 2D sidescroller

I've been making a 2D sidescrolling game using JavaScript and HTML. The game is set in space, where the player character can fly around (Up, Down, Left and Right keys) and rotate the world around him ...
1
vote
1answer
1k views

Is it possible to rotate an image on an HTML5 canvas, without rotating the whole canvas?

So I basically want to rotate single sprites on the canvas without rotating the whole canvas, is that someway possible. I also don't want to create a new canvas for each object I have. Also, it ...
2
votes
1answer
146 views

Difference between rotation methods?

My question is in about rotate methods in android.graphics.Camera. In Docs, I saw these comments: public void rotateX (float deg) Since: API Level 1 Applies a rotation transform around the X ...
1
vote
2answers
778 views

Matrix rotation of a rectangle to “face” a given point in 2d

Suppose you have a rectangle centered at point (0, 0) and now I want to rotate it such that it is facing the point (100, 100), how would I do this purely with matrix math? To give some more specifics ...
2
votes
2answers
4k views

Rotate canvas along its center based on user touch - Android

I want to rotate the canvas circularly on its center axis based on user touch. i want to rotate based on center but its rotating based on top left corner . so i am able to see only 1/4 for rotation ...