The circular movement of an object around a specific axis.

learn more… | top users | synonyms

1
vote
3answers
318 views

Inverting matrix then decomposing gives different quaternion than decomposing then inverting the quat

I'm getting different signs when I convert a matrix to quaternion and invert that, versus when I invert a matrix and then get the quaternion from it: Quaternion a = Quaternion.Invert(getRotation(m)); ...
1
vote
2answers
229 views

How can I determine the direction of turn?

I want a function that gives me the turn direction for my object (1 or -1) I have two angles 1 - current rotation(A) 0 <= A <= 360 2 - target rotation(B) 0 <= B <= 360 int turnSide ...
2
votes
1answer
420 views

Finding a suitable axis-angle to avoid gimbal lock

In OpenGL the camera faces the -z axis with the +y axis pointing up. I am using quaternions to represent the orientation of my objects (which works well) and am trying to do the same for the camera. I ...
5
votes
1answer
4k views

Angle between two points

I have a character who walks to random points in my room in Unity. The problem is he always faces one direction, I want to write in C# a piece of code that will get the direction the character is ...
0
votes
1answer
442 views

Character rotating around target

I'm using xaitment plugin for Unity as the AI for a demo level but I have a problem. My character is supposed to walk to random points but while it's walking there it's rotating around the point. I ...
2
votes
1answer
658 views

XNA and Draw rotation

From Wikipedia the (image) conversion degrees / radians shows the quadrants so that the increase of radians causes a counter-clockwise rotation but when using the following code the sprite is rotated ...
0
votes
1answer
400 views

Joystick example problem for android 2D

I've searched all over the web for an answer to this, and there are simular topics but nothing works for me, and I have no Idea why. I just want to move my sprite using a joystick, since I'm useless ...
0
votes
2answers
881 views

XNA - positioning after rotation

I have a turret with a 2 gunbarrels. The turret rotates towards my mouse. So far no problem. When it creates a few bullets and positions them at the end of the gun barrels. Here is the problem. It ...
3
votes
1answer
417 views

Smoothing rotation

I've spent the last three days trying to work out how to rotate a sprite smoothly depending on the velocity.x value of the sprite. I'm using this: float Proportion = 9.5; float maxDiff = 200; float ...
0
votes
1answer
214 views

Rotation based on x coordinate and x velocity?

-(void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { float deceleration = 0.3f, sensitivity = 8.0f, maxVelocity = 150; // adjust velocity based on ...
6
votes
3answers
794 views

Tetris : Effective rotation

I rotate each piece by rotation formula. More detail, because rotation angle is 90 so : xNew = y; yNew = -x; But my method has met two problems : 1) Out of box : each type of pieces is fit in ...
7
votes
3answers
2k views

How to keep my Quaternion-using FPS camera from tilting and messing up?

I am using an FPS-like camera, and it uses quaternions. But, whenever I try looking up and then sideways, it tilts, and sometimes it can turn upside down. How can I fix this?
0
votes
3answers
564 views

Rotating Sprite around Y-Axis (2D)

I'm going to be creating a game soon, and part of it involves spinning sprites. The sprites will be spinning around the Y-Axis (imagine a spinning plate on top of a stick, where the stick stands up ...
7
votes
1answer
628 views

How To Approach 360 Degree Snake

I've recently gotten into XNA and must say I love it. As sort of a hello world game I decided to create the classic game "Snake". The 90 degree version was very simple and easy to implement. But as I ...
1
vote
1answer
271 views

rotating an object on an arc

I am trying to get a turret to rotate on a 90 degree arc (rotating about 2 orientations about the y-axis), and have hit a wall. I have 8 possible starting orientations (multiples of 45 degrees about ...
0
votes
2answers
971 views

Rotate object Up/Down/Left/Right in any orientation

I'm rendering model at the origin with a fixed camera looking at it positioned on the z axis. I want to be able to rotate the model up/down and left/right. Currently I have 2 variables, ...
0
votes
1answer
240 views

Earth's rotation along it's axis

I've modeled an earth using an sphere. I can rotate it using glRotatef function around z axix by incrementing the angle. How do I simulate earth's movement which looks like 23.5Degree around Z axis? ...
-2
votes
2answers
186 views

C# XNA 4.0 Rectangle Rotation Collision

I can easily rotate my sprite, but how could I rotate my rectangle for my collision (Thinking of using the Separating Axis Theorem, But I have no clue how to apply it) Help or Example would be ...
0
votes
1answer
290 views

Quaternion to axis-angle, or ripping apart a full transform matrix

My game entities currently hold a quaternion for their orientation with the ability to return either a 3X3 full rotation matrix (based on that quaternion), or a full 4X4 transform matrix. though what ...
1
vote
3answers
1k views

XNA create differences in enemies

I created an enemy class for my game. It works well, except for one dilemma. When I spawn more than one enemy, eventually they begin to "overlap" and look like one enemy. I was wondering if anyone had ...
4
votes
1answer
2k views

Moving a rotated model in XNA

This seems like a simple problem with an equally simple solution that is invisible to me. I have a model that spawns at the origin and looks at my player model wherever it goes. I would like it to ...
1
vote
4answers
2k views

Rotating a model AND translating it forward in XNA

I have this enemy class, and I want it to 1) Spawn at a certain place Vector3 pos 2) Rotate to face my player position 3) Move forward As this code is now, it will appear at it's specified place: ...
7
votes
2answers
1k views

Calculating a quaternion so a bone points in a specified direction

In an attempt to solve this question, I decided to figure out the absolute (world space) directions of each joint in the source pose (as normalized unit vectors), and then rotate the joints of the ...
0
votes
1answer
792 views

Camera Rotation (for mouse look) with LookAt does not work as expected (Local/Global)

My code for rotating my 3D fps camera isn't working as expected. I expect that the X-axis does rotate with the Y-axis, but it ain't so. I made some pictures to explain it better, I think its doing ...
0
votes
1answer
112 views

Creating a 2D Line Branch (Part 2)

Yesterday i asked this question on how to create a 2D line branch; Creating a 2D Line Branch And thanks to the answered provided, i now have this nice looking main branch; *coloured to show the ...
2
votes
1answer
1k views

Flip rotation matrix

I'm doing character control with kinect. I need to mirror the joint orientation because the character faces the player. Somehow by Googling through internet I've done it and everything works very ...
6
votes
2answers
1k views

Simple thruster like behaviour when rotating sprite

I'm prototyping some 2D game concepts with XNA and have added some basic keyboard inputs to control a triangle sprite. When I press key up the sprite accelerates in it's current facing direction, ...
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 ...
3
votes
2answers
560 views

Passing an objects rotation down through its children

In my topdown 2d game you have a player with a sword, like an old Zelda game. The sword is a seperate entity, and its collision box "rotates" around the player like an orbit, but always follows the ...
4
votes
1answer
640 views

Arcball Problems with UDK

I'm trying to re-create an arcball example from a Nehe, where an object can be rotated in a more realistic way while floating in the air (in my game the object is attached to the player at a distance ...
1
vote
1answer
388 views

OpenGL: Rotating cannon about non-centre position?

So I have a "cannon" object (basically a long cylinder) and I want to be able to control its angle. The code I have now is: glPushMatrix() glTranslatef(self.position.x,2.5,self.position.z) ...
2
votes
5answers
3k views

How to make something rotate a certain amount over an exact amount of time

I'm trying to make a plane rotate down a certain amount and 180 degrees horizontally over 2 seconds. Basically I want it to take the plane 1 second to rotate to a horizontal-facing angle, then take ...
5
votes
3answers
743 views

Rotate a particle system

Languages / Libraries in use: C++, OpenGL, GLUT Okay, here's the deal. I've got a particle system which shoots out alpha blended textures to produce a flame. The system only keeps track of very ...
1
vote
1answer
2k views

Moving an image by rotating and increasing y axis causes a trailing issue

Forgive me if me anything is unclear, this is a tricky thing for me to explain. In an applet I draw a little ship gif. I have it so I can rotate the object and then increase or decrease the y axis to ...
1
vote
2answers
825 views

Transformation order when dealing with Meshes

I have created a player model out of primitive types. To do this I have created a Model class and Component (mesh) class. Each model consists of one or more components my problems start when you have ...
2
votes
3answers
2k views

Can I use SpriteBatch when drawing sprites on a rotating 3D plane

I'd like to have my plane of sprites rotate similarly as in this game (YouTube Video). So basically, everything is drawn in 2D, but the 2D plane is then "rotated in 3D" (or camera is rotated). When ...
0
votes
0answers
844 views

Box2d : Sprite display not fit with body when rotated

I have recently achieved to render box2d Objects, and texture with sprites at where the box2d objects exists. But now I am facing another problem. When I rotate the Box2D object, the sprite gets ...
1
vote
1answer
3k views

Rotation of images in Slick2D

I have have a rotation problem in the Slick2d library, the image is just not rotating (ie I set a rotation but no result is shown). Here is the rotation code: if (input.IsKeyDown(Input.KEY_LEFT)) { ...
2
votes
2answers
842 views

What is the difference between Vector2.Transform and this method?

I've been working on some steering behaviors and ran into trouble with my logic for converting points in world space into points in local space. I had this (it's not optimized for multiple points yet, ...
0
votes
1answer
426 views

Rotate an existing quaternion around an axis?

I have an existing quaternion (Java Quat4f). I would like to rotate this quaternion around an axis (i.e. 90 degrees around the x axis, 25 degrees around the y axis, 10 degrees around the z axis, 180 ...
1
vote
1answer
2k views

Move an object by rotation AS3

I am currently trying to move an object (a square) around the stage in 2D space. Think Cuboid but in 2D platformer space, and vertical walls as well as the ground. The idea is that during each ...
2
votes
1answer
2k views

How to control a spaceship near a planet in Unity3D?

Right now I have spaceship orbiting a small planet. I'm trying to make an effective control system for that spaceship, but it always end up spinning out of control. After spinning the ship to change ...
4
votes
1answer
351 views

Clock hand, how much should I rotate the hand by every frame?

I've got a virtual clock. The clock consists of the actual clock sprite, and a hand to go over it. I'm able to set how long the clock duration is. Say I set it to: 5 seconds. While the clock time is ...
4
votes
3answers
592 views

How to calculate origin and position of a weapon which should be “in hands”?

I'm currently stuck with my game, which is from the top perspective. I'm currently using these sprites for player: (using the second at the top): And here's what I use for my gun My problem is ...
3
votes
4answers
815 views

Is it better to track rotation with a vector or a float?

In XNA, you can see that to draw a rotated sprite with SpriteBatch, you'll need a float describing the angle in radians. I'm used to making games in OpenGL. I just want a rapid prototyping ...
0
votes
2answers
1k views

from normal to rotation matrix

(i'm on OPENGL) i have a mesh O (object) and a mesh T (terrain). i know a single triangle in T and i want to orient O to be aligned to that triangle (torate O to align to T in that point). i have ...
3
votes
2answers
892 views

How can I make a sprite move in the direction it's facing using radians?

I am using PGELua for the PlaystationPortable. I would just like to know how to make a 2D sprite move in the direction that the sprite is facing. When the sprite is blitted to the screen it should ...
2
votes
1answer
588 views

Positioning a 2D image after rotation

Using SDL_gfx's rotozoomSurface function to rotate a 38x58 sprite....naturally when it rotates it creates a new surface with a new size, and the rotation isn't going around the center point. I am ...
4
votes
2answers
736 views

I need help with 2D collision response (of stacking rotating polygons, with friction and gravity, for a game)

Hi I am looking for suggestions on how to write a collision response for game programming purpose (so not a scientific simulation). I am dealing with 2D polygons that are rotating, and I want them to ...
2
votes
1answer
1k views

How can I create my mesh so that textures applied to it are NOT rotated 90 degrees in Unity 3D?

I'm trying a really simple test in Unity 3D. I want to render a texture on the simplest plane possible. So, I've created a two-triangle plane in Blender, then imported it into Unity. From there, I ...