Tagged Questions

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

learn more… | top users | synonyms

1
vote
2answers
159 views

Quaternion Rotation - Clockwise or Counter-Clockwise?

when we specify a Quaternion as (axis of rotation, rotation amount), in which 'direction' is the rotation, assuming we are looking down the rotation axis (i.e. camera at the origin, looking along the ...
0
votes
0answers
13 views

libgdx y axis rotation (card flip)

I am a complete new user to libgdx and am looking to use it to write a simple card game. I want to be able to flip my cards over to reveal them, in the same way as this example from Google shows. ...
0
votes
1answer
51 views

Lookrotation of a gameObject in just one axis

So I am trying to orient a gameObject ( house in the picture below) which is nothing but a plane and has a 2d texture on it as you see below. The whole game is made on a hex sphere. I am using ...
-1
votes
0answers
28 views

Adding Spread to Guns

I'm creating a FPS, and I have a Coordinate Frame with the barrel's position and rotation. I want to add spread to the guns, and from what I understand the best way to do this is to generate a ...
0
votes
1answer
178 views

2D sprite 360 degrees rotation according to the mouse

I am trying to make my top down character rotate according to degrees between its position and the mouse. I'm using this code: float xDiff = mouseState.X - (graphics.PreferredBackBufferWidth / 2); ...
0
votes
0answers
29 views

Applying angular velocity distorts model

I am calculating the orientation of a sphere through the following code wV = new Vector3(0, pi/2, 0); w = new Quaternion(wV, 0); // o is the current Orientation o.Normalize(); w = 0.5f * w * o; // dt ...
0
votes
3answers
69 views

How to calculate corner marks of a rotated rectangle?

I've got two elements, a 2D point and a rectangular area. The point represents the middle of that area. I also know the width and height of that area. And the area is tilted by 40° relative to the ...
0
votes
1answer
72 views

How to rotate and move a model in the direction it is facing?

I am not using Unity or XNA. Eventually, I will probably use OpenTK for graphics. But for the concept of a game I'm writing, I am using the console for keyboard input and visual logging of events, ...
0
votes
0answers
36 views

OpenGL ES 2.0 - Applying rotation to only specific quads within a batch

This problem seems fairly simple on the face of it: How, when drawing a batch of quads using a triangle strip, can I apply a rotation to only one or some of the quads. I've been looking at this ...
1
vote
0answers
47 views

Aligning a gameObject to position and normal of another gameObject inside Unity

So I am instantiating a GameObject (the one with cities and trees in the image below) and trying to align it to a hex tiles on a Sphere. So after I instantiate the gameObject, I ray-cast to get it ...
1
vote
1answer
59 views

Get quaternion between two objects on sphere

In a planetary gravity environment objects are represented in the following way: struct object { struct quaternion quat; // quaternion to represent the rotation between the object and the center ...
3
votes
2answers
168 views

How do I make a 2D race car turn smoothly? [duplicate]

I'm making a competitive 2-player 2D racing game for a school project. I'm struggling with the movements of my car: I made it a square for testing purposes and it can move left, right, up or down, but ...
0
votes
0answers
46 views

3d Rotation problem

I was given an interesting (but tough) problem to solve: In a game, you want to change the heading of an enemy by +30°. Construct a Rotation Matrix, Euler Angles and a Quaternion that would do this. ...
0
votes
0answers
103 views

3d game math problem [duplicate]

i'm very much new to 3d math operations. I know how to rotate 3d points certain degrees arbitrarily by any axis but we were given a strange problem to think on. I'll spare using actual numbers on ...
0
votes
1answer
63 views

3D Translations relative to 3D Rotations

I'm trying to program camera movement to be relative to camera rotation. (Forward is always forward, regardless of pitch, yaw, and roll) I want to be able to move forward, backward, left, right, up, ...
0
votes
1answer
73 views

Can't seem to get Sprite to face left in sfml c++

I am having some small issues getting my sprite character to flip around. Basically I have a character that can walk to the right.. I am looking to flip it so that it looks like it is walking left. I ...
1
vote
0answers
113 views

2D Rotation Transform Matrix Issues

I'm stuck on my computer graphics class homework. I'm sorry if this is not right place to ask. I think this is closest thing to computer graphics. My assignment is to create basic 2D colored ...
1
vote
1answer
146 views

Mouse click movement

I need to make realistic human movement (3D) using mouse click. Get mouse click point using Raycast. Smoothly Slerp to LookRotation. Move transform.forward. Everything works fine, except I have ...
1
vote
0answers
84 views

Rotating a scene around a fixed axis

I am looking for a way to move my scene so that when I translate forward/back/left right it moves directly up/down/left/right on the screen. Currently it does do that until I rotate (by anything ...
0
votes
2answers
87 views

Strange quaternion rotation

I was implementing some quaternion rotations in too my infant 3d game engine and the rotations were really strange? Excuses my cluelessness. Anyways this is what I have: static XMVECTOR ...
0
votes
2answers
96 views

Quaternion Rotation Help

So I'm making a little engine with DirectX 11 and C++. (Some other help from other API's as well) DirectX has this function XMMatrixRotationQuaternion(XMVECTOR quaternion). I know nothing about this ...
2
votes
2answers
77 views

How can I make an object move in four directions relative to its rotation?

I want to make a game object move in directions relative to the direction is facing. That is, If the user presses the "W" key the object goes "forward" if its presses "D" the object goes to its left. ...
0
votes
0answers
77 views

X, Y, Z rotation around camera

I'm making a 3d orthogonal-projected, game using painters' algorithm in java. I'm able to rotate the objects with incremental rotations (e.g. rotate all objects 10 degrees) using affine ...
2
votes
1answer
81 views

From 3d rotation, snap to nearest 90 directions

I have a 4x4 transformation matrix, made only from successive rotations and translations, and I'd like to "snap" my object to the "nearest" of the 24 orthogonal (multiples of 90 degree) rotations. ...
1
vote
1answer
94 views

How to rotate object not from it's center point but from it's another point?

I am new in unity and I am developing a game where I want to rotate my object I try this code for it. if(Input.GetMouseButton(0)){ if(Input.GetMouseButtonDown(0)){ ...
0
votes
0answers
17 views

How can I control the “speed” of a func_rotating object via Squirrel scripting in Portal 2?

I wish there was a better place to ask this, but I've ran out of ideas (after googling and finding nothing even close to what I'm looking for). I basically have this rotating platform. At the ...
0
votes
1answer
146 views

Why are my target-following objects rotated the wrong way?

I writing a script that would make my players reach a target destination. It looks like this so far: private void MoveTowardsGoal() { if (Vector3.Distance (reachGoalTarget.transform.position, ...
0
votes
1answer
576 views

Unity 2D, C# - Make object move diagonally by a certain angle?

I have a sprite object which I want to move in 8 directions. Left, Right, Up, Down, Left top, Right top, Left down, Right down. The view is 2D with a isometric projection. The difficulties I am ...
0
votes
0answers
42 views

Camera rotation issue Libgdx

I have a OrthographicCamera and I want to rotate 90° it, but when I rotate it seems to be shifted more to the right. Before rotation: http://postimg.org/image/tc9jpq9zr/ After ...
1
vote
1answer
47 views

Rotating a square rendered on a Bitmap

I'm writing a Software Renderer for fun/learning. Basically, it's just a giant array of integers which contain hexadecimal values (representing colour) that are rendered to the screen.... int ...
0
votes
2answers
256 views

Set new forward directions based on camera position

I have a 3rd person camera which can rotate around the player. When I look at the back of the player and press forward, player goes forward. Then I rotate 360 around the player and "forward ...
1
vote
1answer
191 views

Box2D body rotation with setTransform

I' having a problem rotating a body with setTransform(), The body has multiple sensors that should rotate with the player. The rotation works but it rotates around the bodys local 0,0 position instead ...
0
votes
1answer
381 views

How can I make my player move in the direction the camera faces?

I have a 3rd person camera which can rotate around the player. My problem is that wherever camera is facing, players forward is always the same direction. For example when camera is facing the right ...
0
votes
4answers
140 views

Accurate sprite rotation with mouse movement

I am using the current mouse position to aim the player sprite, but I am not getting the best results. It will often by off by a noticeable amount, or even a complete ~180 off if I go from one side, ...
0
votes
1answer
333 views

Simultaneously translating and rotating sprite in Unity

I have a 2D object (a PNG file I dragged onto the screen) which is a circle I would like to move left and right when the correct side of the screen is touched and have it rotate in the respective ...
1
vote
1answer
66 views

Gradually reduce speed

Basically I am working on following application of android version Party Games: Drinking Wheel For this I want to rotate wheel and want to stop wheel at specific point. But I want this with gradually ...
1
vote
2answers
165 views

What torque should I apply in Bullet to maintain a vertical orientation?

I have a RigidBody in Bullet. Each frame, I want to apply torque to correct its orientation toward an upright position (i.e. near-zero pitch and roll). I know its angular velocity and orientation. ...
2
votes
1answer
88 views

How can I trigger an event each time the rotation of my rigidbody2D is at a given value?

I would like to trigger an event each time my rigidbody2D is at a particular value. The event should only be triggered once for each given value per complete object revolution. Initial attempts at ...
0
votes
1answer
88 views

Rotating a vector around a vector in 3D space

I am trying to rotate a moon around a planet (the planet is also rotating around an axis) but I am having trouble doing so. I tried to make the model move through space like so: @Override public ...
0
votes
2answers
124 views

Why do we say things are rotated around the z-axis in a space graph?

I've embarked on a journey of game development. I need to learn lots of 3D terminology, since I want to make 3D games. I learned that X is to the right, Y is up, and Z is towards you. Then why when a ...
1
vote
0answers
39 views

PhysX - Revolute joint around unit vector

I'm using a right-handed coordinate system with (0,0,-1) = forward, (1,0,0) = right and (0,1,0) = up. PhysX version is 3.3.0. I have a unit vector which represents the axis around which my actor is ...
1
vote
1answer
26 views

Error in plane transformation

I have a bunch of coplanar points, who sit on plane P. I want to translate the plane to Q with the points upon. Here is what I do: I take three points from P, say a, b, c. Their centroid is denoted ...
0
votes
1answer
91 views

Rotation with XMMatrix to Rotation with XMFLOAT3

I'm rotating a Direction Light around a fixed object, so the light only contains a XMFLOAT3 to determine it's direction that it is facing. I have another object rotation using the variable Rotation ...
0
votes
1answer
57 views

Get 3D quad rotation matrix from points

I have 4 3D points which represent a even quad in space. (So 3 points are sufficient) I need to get all the individual transformations (translation, rotation, dimensions) so that I can build that quad ...
2
votes
2answers
237 views

How can I simplify this code to compute the shortest rotation between two angles?

The following code will find the shortest rotation (in radians) (from pi to -pi) that I need to apply to from to leave me with to. Scalar rotationBetween(Scalar from, Scalar to) { Scalar fromMod ...
1
vote
0answers
32 views

Unity 2D angular velocity center [duplicate]

I try to add angular velocity to my GameObject with this command: rigidbody2D.angularVelocity = Random.value * tumble; All works, but I want center of velocity be in the center of my rigidbody, but ...
2
votes
0answers
117 views

Three.js camera turning leftside right

In Three.js I am trying to implement an orbiting camera can be rotated around the x and the y axis. I am using these two functions: function rotateX(rot) { var x = camera.position.x, ...
0
votes
0answers
51 views

Camera movement in Super Hexagon

I do realize there is no camera in OpenGL ES 2, but from my understanding you can simulate one using view and projection matrices. I'm using Android, by the way. Here's a video of the game, in case ...
0
votes
1answer
74 views

3d rotation of a Gunner unit to shoot the target

I'm developing a scenario to shoot incoming targets by a specific gunner unit, however I'm confused to actual logic of shooting an object with a gun. I'm working in 3D environment. I'v target's ...
2
votes
2answers
91 views

What are “local” and “global” rotations?

Each node in jME3 has local and global rotations, which can be expressed in quaternions. What are they? Documentation has no clues, about in which state rotations are zero?