The circular movement of an object around a specific axis.
2
votes
3answers
532 views
How to Align Gun with Bullets
I have a top-down 2D shooter. I have an image of a player holding a gun, that rotates to face the mouse. Please note that the gun isn't a separate image tethered to the player, but rather part of the ...
2
votes
2answers
237 views
Rotating a child shape relative to its parent's orientation
When rotating a shape using a quaternion value I also wish rotate its child shape.
The parent and child shapes both start with different orientations but their relative orientations should always be ...
1
vote
1answer
458 views
Rotate triangle so that its tip points in the direction of the point on the screen that we last touched
OpenGL ES - Android.
Hello all, I am unable to rotate the triangle accordingly in such a way that its tip always points to my finger.
What i did : Constructed a triangle in by GL.GL_TRIANGLES. Added ...
1
vote
1answer
661 views
Rotate to a set degree then stop Unity [closed]
I'm trying to make an object rotate up on the Y axis 90 degrees, then stop. I've got the rotating up bit working fine, it's getting it to stop once it hits 90.
Some of the things I've tried include ...
8
votes
4answers
226 views
Keeping rotation between two objects
In my XNA game I have two objects that collide. When the first object collides with the other it is able to latch on to it and move it about the world. I am having a problem with the math here (Math ...
1
vote
1answer
218 views
How to I get a rotated sprite to move left or right?
Using Java/Slick 2D, I'm using the mouse to rotate a sprite on the screen and the directional keys (in this case, WASD) to move the spite. Forwards and backwards is easy, just position += ...
4
votes
2answers
1k views
Move sprite in the direction it is facing?
I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction ...
0
votes
2answers
325 views
Can't get sprite to rotate correctly? [closed]
I'm attempting to play with graphics using Java/Slick 2d. I'm trying to get my sprite to rotate to wherever the mouse is on the screen and then move accordingly. I figured the best way to do this was ...
1
vote
1answer
383 views
Pitch camera around model
Currently, my camera rotates with my model's Y-Axis (yaw) perfectly. What I'm having trouble with is rotating the X-Axis (pitch) along with it. I've tried the same method for cameraYaw() in the form ...
0
votes
1answer
237 views
(Quaternion based) Trouble moving foward based on model rotation
Using quaternions, I'm having trouble moving my model in its facing direction. Currently the model moves can move in all cardinal directions with no problems. The problem comes when I rotate the move ...
6
votes
1answer
214 views
How can I get a 2D texture to rotate like a compass in XNA?
I'm working on a small maze puzzle game and I'm trying to add a compass to make it somewhat easier for the player to find their way around the maze. The problem is: I'm using XNA's draw method to ...
7
votes
1answer
861 views
Xbox thumbstick used to rotate sprite, basic formula makes it “stick” or feel “sticky” at 90 degree intervals! How do you get smooth rotation?
I am using a very basic formula to calculate what angle my sprite (spaceship for example) should be facing based on the Xbox controller thumbstick i.e. you use the thumbstick to rotate the ship.
In ...
1
vote
3answers
219 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));
...
0
votes
1answer
371 views
rotating model around own Y-axis XNA
I'm have trouble with my model rotating around it's own Y-axis. The model is a person.
When I test my world, the model is loaded at a position of 0, 0, 0. When I rotate my model from there, the ...
1
vote
2answers
2k 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 ...
3
votes
2answers
297 views
How to derive euler angles from matrix or quaternion?
Currently working on steering behavior for my AI and just hit a little mathematical bump.
I'm in the process of writing an align function, which basically tries to match the agent's orientation with ...
8
votes
2answers
290 views
Render 3d object to 2d surface (embedded system)
i am working on an embedded system of a sort, and in some free time i would like to test its drawing capabilities.
System in question is ARM Cortex M3 microcontroller attached to EasyMX Stellaris ...
1
vote
1answer
356 views
Scene graph in Unity3D
I was wondering if any scene graph-like mechanism is implemented into Unity3D? For example if I have a GameObject, can I add child cubes to it so when I rotate the parent GameObject, the siblings will ...
-5
votes
1answer
117 views
is object facing another object or facing it in opposite direction?
In 2d, in degrees, negative degrees possible.
What I want is to rotate the player to face the same direction as the door before opening it, but when I'll do the same again now from the opposite side, ...
1
vote
0answers
168 views
Getting and Setting Rotation in XNA around the Center of my Model with XNA
Alright, so I'm currently debating how I want to do this. Basically this is what I'm trying to accomplish.
I've created a system to allow me to make my environment a little bit easier. I'm ...
1
vote
2answers
1k views
Rotation matrix derived from quaternion is opposite of expected direction
When I calculate a rotation matrix from a quaternion, it seems to be in the opposite direction. For instance:
For a rotation of +45 degrees about the Y-axis, I would expect to get the following ...
1
vote
1answer
749 views
Vector movement in space type game (Mouse rotation)
I'm having an issue with my movement in my 'game' prototype. It's basically not working and admittedly my knowledge with vectors is lacking.
The issue I'm running into is that the ship won't move in ...
2
votes
1answer
416 views
Rotating To Face a Point
I am trying to rotate a line to point to the mouse's world coordinates (rather where the mouse lies on the plane where y=0).
I am running into a couple of problems though:
Whilst it follows the ...
1
vote
2answers
169 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
301 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 ...
1
vote
1answer
1k 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
236 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
376 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
2answers
518 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 ...
0
votes
1answer
343 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
1answer
840 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 ...
3
votes
1answer
311 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
181 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
369 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 ...
3
votes
3answers
793 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?
6
votes
1answer
439 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 ...
2
votes
2answers
2k views
Cocos2d rotating sprite while moving with CCBezierBy
I've done my moving actions which consists of sequences of CCBezierBy. However I would like the sprite to rotate by following the direction of the movement (like an airplane). How sould I do this with ...
1
vote
1answer
232 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
1answer
162 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
139 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
215 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
814 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 ...
7
votes
2answers
845 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 ...
1
vote
4answers
1k 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: ...
3
votes
1answer
1k 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 ...
0
votes
1answer
574 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 ...
2
votes
4answers
1k 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 ...
2
votes
1answer
490 views
Image spinning in c#
I'm currently in the process of making a top-down shooter for my programming class, and one idea I had, but don't exactly know how to implement is image rotation in order to spin the object ...
0
votes
1answer
101 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
699 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 ...
