# Tagged Questions

Rotation is the circular movement of an object around a specific axis.

9k views

### How to rotate blocks in tetris

I have a gameboard grid which is 20 rows high and 10 columns wide with the origin (0,0) being in the top left hand corner. I have a tetrimino in play, which is composed of four blocks. I have the x,y ...
944 views

### Allegro 5 Mouse Look

I found good tutorial on how to do mouse look for 2D game here: http://www.atburrow.com/2010/03/08/objects-facing-the-cursor/ My code looks like this: w = (double)mouse_x - (double)pos_x; h = (...
704 views

### Quaternion understanding

I have some understanding problem concerning quaternions. In order to have my world object rotate in the correct way, I need to invert their quaternion rotation while refreshing the object world ...
863 views

### Rotation deforming mesh (Opengl ES 2.0)

I'm trying to render a rotating cube on Opengl ES 2.0, using some math classes I wrote (based on a lot of online and offline info) for quaternions, matrixes and the like. As far as I know all the math ...
7k 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 ...
4k views

### How do I rotate a structure of hexagonal tiles on a hexagonal grid?

My 2D isometric game uses a hexagonal grid map. In reference to the image below, how do I rotate the light blue hexagon structures by 60 degrees around the pink hexagons? EDIT: Main hex is (0,0). ...
1k views

### Turning a sprite such that it rotates in the direction that's most efficient

I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed). The problem I'm having is, from one direction to another, the ...
2k views

### XNA - Use Mouse To Rotate & Arrow Keys To Scroll A Linearly Wrapped Texture:

Using XNA I'm working on my first, relatively simple, videogame for the PC. At the moment my game window is 1024 X 768 and I have a 'Starfield' linearly wrapped background texture 1280 X 1280 in ...
1k views

### AABB of rotated sprite?

Say I have a sprite. Its AABB is easy to find since I know the width and height. Say I rotate it 45 degrees, I don't think the AABB would be big enough to cover it, so I need a new AABB. How can I ...
807 views

### Can I use quaternions to control an helicopter?

I'm trying to make a simplified helicopter (for the moment, it's a cube) simulation in 3D and I'm having some problems with rotation. An helicopter can rotate along the three axes : rotate on itself ...
544 views

### CubeRealm OpenGL rotation problems, need help. :\

I'm totally new to OpenGL and I'm working on a Sandbox game called CubeRealm. My problem you see is rotation. I've got it in my head that to rotate the 'camera' I just rotate all the scene by the ...
5k views

### LWJGL glRotatef() without rotating axes?

Okay so, I noticed when you rotate around an axis, say you do this: glRotatef(90.0f, 1.0f, 0.0f, 0.0f); That will rotate things 90 degrees around the x-axis. However, it also sort of rotates the y ...
1k views

### What is eigenvalue decomposition and why would it be useful in games?

In various math libraries developed for game engines, I see 2x2 and 3x3 square matrices having this function (along with some helper functions). I tried to find information regarding it but did not ...
7k views

### How to rotate a rectangle?

I can easily rotate sprites using the Draw method. However I would like to simply rotate a Rectangle (the structure) so that I can get the coordinate of the four corners of the rectangle. How can I do ...
11k views

### GLM: Euler Angles to Quaternion

I hope you know GL Mathematics (GLM) because I've got a problem, I can not break: I have a set of Eular Angles and I need to perform smooth interpolation between them. The best way is converting them ...
505 views

### Linear Interpolation Causing Gimbal Lock?

I have created an object movement path in a 3D authoring application. Then, I exported the path (100 frames) into my custom text file in the form of Euler Angles. The next point was loading the ...
3k views

### Need a good quality bitmap rotation algorithm for Android

I am creating a kaleidoscopic effect on an android tablet. I am using the code below to rotate a slice of an image, but as you can see in the image when rotating a bitmap 60 degrees it distorts it ...
494 views

### opengl rotations for a human

I currently can rotate around a pivot point by first translating to the pivot point then performing the rotation and finally translating back to the origin. I do that easily enough for the shoulder in ...
499 views

### Rotating coordinate system

Lets say that you want to rotate simple cube around fixed point in center. Is it possible to use such coordinate system, that you need to use only sine and cosine in order to rotate? I have done ...
4k views

### per pixel based collision detection

I was wondering if anyone had any ideas on how to get per pixel collision detection for the android. I saw that the andEngine has great collision detection on rotation as well but couldn't see where ...
3k views

### Rotation of bitmap using a frame by frame animation

I have one large bitmap that has four frames drawn on it and I only draw one at a time by looping through the bitmap by increments to animate walking. I can get the bitmap to rotate correctly when it ...
1k views

### rotate player based off of joystick

Hey everyone I have this game that i am making in android and I have a touch screen joystick that moves the player around based on the joysticks position. I cant figure out how to also get the player ...
4k views

### 2d tank movement and turret solution

I'm making a simple top-down tank game on the ipad where the user controls the movement of the tank with the left "joystick" and the rotation of the turret with the right one. I've spent several hours ...
3k views

### Weird rotation problem

I'm creating a simple tank game. No matter what I do, the turret keeps facing the target with it's side. I just can't figure out how to turn it 90 degrees in Y once so it faces it correctly. I've ...
294 views

### How can I draw a model perpendicular to a sloped surface? [duplicate]

Possible Duplicate: How do I find rotation in 3D based on a vector/normal? My models are axis-aligned. I know the normal of the surface I want to draw them on. How do I compute the rotations ...
204 views

### Can't figure get the conversion from cartesian to spherical(“polar”) correctly for my orbiting camera

The two angles from the polar coordinate system are defined as hRotation and vRotation This is how they are converted from polar to cartesian: // Get the distance between the object and the ...