Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rotation]

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

0
votes
1answer
27 views

Unity - Calculating a rotation based on game time

I have a simple script to make an object spin: Spin Speed is the speed to rotate the object on each axis (preferably in degrees per second). Local is whether the rotation should be done based on ...
0
votes
1answer
20 views

Order of rotation in Euler angles

I'm want to control the direction my camera looks, so I'm using Euler angles, so rotating around an axis is relative to rotation around previous axis. Something like this. I want to always rotate ...
0
votes
1answer
29 views

2D Rotation of an object along a curve line

I would like to rotate an object along a curve. I managed to move the object along the curve using bezier curve algorithm. The hard part is to rotate the object constantly(no limit on maximum angle), ...
0
votes
1answer
18 views

Can't rotate object after using transform.forward

I'm using above code to rotate object pointing where it moves: transform.forward = m_Rigidbody.velocity; It works fine, however the problem is that I can't ...
0
votes
0answers
10 views

Pathfinding/Steering with limited rotation [duplicate]

I am looking for an algorithm to guide some ships in a turn based game. The trouble is they should have a limited rate of turn, and I want them to navigate them to both a target position and a target ...
0
votes
0answers
12 views

how can i set the y rotation of an object equal to another objects y rotation without rotating it on all the rest of the axis

Here is my attempttransform.rotation = new Vector 3(0,pivot.rotation.y,0); I don't know what to do can you help in any way? I have a camera that pivots around the ...
0
votes
1answer
30 views

How do I get a relative rotation between two positions?

For example, I have two objects: a & b. a's position is 12, 16, -2 and b's position is 14, 16, -3 I need to know how to find a relative rotation between them. By relative rotation I mean this: ...
0
votes
1answer
13 views

Ecliptic rotation around parent object

It seems to be answers.unity.com not working for a couple of days, so I ask my question here. Well, I'm using Unity and I have two objects (A and B). Object A is a parent of object B and object B is ...
1
vote
0answers
59 views

Doom-style 8 directions sprite math HELP C++ [duplicate]

I'm trying to get Doom-style 8 direction sprite rotation that changes its sprite depending on the camera and the forward vector of the entity just like this video here: https://www.youtube.com/watch?v=...
1
vote
1answer
53 views

How to stop camera rotation after reaching a specific angle?

I have a camera in my scene that I want to rotate around the player. The rotation is done when the camera rotation state is at CameraRotation.Left or CameraRotation.Right and CameraRotation.None ...
0
votes
0answers
16 views

creating rotation matrix in a left handed coordinate system from a direction vector

I have been looking at creating rotation matrices from a direction vector in the OpenCV coordinate space and there is one thing that has me slightly confused. Here is an OpenCV rotation matrix, that I ...
1
vote
1answer
42 views

Calculate heading required to turn ship so that its weapon can fire at target

I have a ship, the ship travels towards a heading (vector3, blue arrow) with an arbitrary speed. The ship has a weapon on the side, the weapon can point in any direction, except straight forward/...
0
votes
1answer
27 views

Why rotating an object only on its local X axis result in sudden 180 degrees changes in Y and Z axis rotation values

I have an object (cube) in the scene and I want it to continuously rotate on its only local X axis but suddenly while rotating on X axis its Y and Z axis rotation value goes 180 degrees for some ...
0
votes
1answer
27 views

How to align 2 IMUs' quaternions?

Suppose I have 2 IMUs that output 2 quaternions. I place one IMU on my left hand and another one on my right hand. I put both my hands flat on the table and point it forward to the same direction. ...
0
votes
2answers
110 views

Is there any way to keep the applied torques in the old planes, even if the ship's local plane has rotated?

I'm trying to make a space shooter game in Unity3D with realistic spaceship physics. I have a problem with correct rotations. When I apply torque in global coords system it will always apply them in ...
0
votes
1answer
51 views

How to change two rotation axes in Unity without affecting the third?

I have a GameObject in Unity and I need to change its X and Z rotation without doing anything with the Y, as that would mess up everything. Note that this sets the Y rotation to 0 and I don't want ...
0
votes
0answers
46 views

How to rotate bones in Unreal using ONLY C++?

I have a reference to a SkeletalMesh. As a test I'm able to move the mesh with the AddLocalTranslation, so I know I have the reference to the correct object. So I created a bone map with bone names as ...
0
votes
1answer
62 views

Combine rotation XZ (horizontal) with YZ (vertical). Math formula

I'm trying to make a rotation vertically and horizontally around a point at the same time but I'm not able to combine both. I have this formula for the horizontal rotation: ...
0
votes
1answer
28 views

Problems when rotating object to animate in Unity

I am trying to create some animations for a car model in Unity and I have a problem with the rotation of the wheels https://imgur.com/a/HcWxyob Here I can set the rotation properly as the pivot ...
0
votes
3answers
107 views

Creating orientation Quaternion from forward vector

Suppose that I have an orientation Quaternion Q, I can compute its forward vector from V = Q * Vector3.forward easily. ...
1
vote
0answers
24 views

Blender - Exporting and Replicating Bone Animation

I'm having trouble replicating Blender bone animation in my game. Bones that have a vertical rest position (Euler(PI / 2, 0, 0)) are animated correctly (e.g. head, neck, torso, legs, shins), however ...
0
votes
1answer
30 views

How to eliminate roll rotation?

Let's say I have Rotation(0, 0, 180) [pitch, yaw, roll]. How to do it that I would have Rotation(180, 180, 0) which is exactly the same?
0
votes
1answer
34 views

How do I rotate finger joints using controller input?

Suppose I have an index finger composed of 3 cubes which all contain Rigidbody which have isKinematic set to true. In a ...
0
votes
0answers
24 views

How do I apply rotations to parent child using Rigidbody? [duplicate]

I have a finger object. It is just three cubes representing the finger parts. The 2nd cube is the child of the 1st one. And the 3rd cube is the child of the 2nd one. This is the heirarchy: ...
0
votes
1answer
41 views

Can you decompose a rotation into a rotation around an axis and a quaternion?

I have a rotation represented by a quaternion and I want to get a rotation angle around the forward axis together with another quaternion which will together represent the original rotation. The ...
2
votes
3answers
158 views

Godot 3.0 Constant 2D Angular Velocity

I am making a Top-Down shooter in Godot 3.0 on Linux. I would like to have my character rotate to face the mouse-pointer at a constant speed, and have rotation speed power-ups that allow the player ...
0
votes
1answer
175 views

how to use glm::rotate with a eulerangle?

I have a vec3 to represent my object's orientation/rotation but the glm::rotate method expects a quaternion. If I just convert ...
0
votes
0answers
88 views

UE4 Blueprint Node Ordering, Vector Rotation and Child-Actor Communication woes

Right now, I'm trying to familiarize myself with UE4 by building a simple Tetris clone. I've hit a snag with the rotation of my tetrominoes. I'm working with three types of actors (Cube, TetrisLine ...
1
vote
1answer
215 views

How do Axis-Aligned Bounding Boxes update with rotations?

I have a bounding box class with a min (x,y,z) and max point (x,y,z). The object that is being rotated has a rotation matrix (3x3 matrix), but I don't know how to update the bounding box with ...
2
votes
1answer
131 views

Reconstruct Quaternion from 48 bit rotation data

I'm trying to reverse an animation file from a commercial multiplayer game, whose format was recently updated. The problem lies within joint rotation information, which changed from a 128bit format to ...
0
votes
3answers
57 views

How to Make Snaky Inchworm Motion With Armature Staying Upright

I have a series of connected bones in a straight line. I want to be able to rotate each bone vertically and/or horizontally so that it can slither and arch randomly kinda like a snake mixed with an ...
0
votes
1answer
14 views

Unity Rotations Not Following Local Nor Global Axis?

In the gif below, you can see that rotating on X moves all 3 axis including the X axis. It's possible it's rotating on the global X rather than local X (hard to tell). But Y looks more like it's ...
0
votes
1answer
68 views

Rotating 2D positions without rotating graphics

I am working on a basic 2D game from an overhead/fake isometric perspective. Arrow keys move the camera left/right/up/down. The trouble occurs when I tried to add rotation. I want the player to be ...
0
votes
1answer
64 views

Can I position a player avatar behind the camera based on rotation?

I'm currently reverse engineering a video game where what's rendered on the screen depends on the proximity of the player avatar to the camera. As such, for my freecam to work properly, I need to ...
0
votes
1answer
61 views

How can I use a redundant axis of rotation to prevent gimbal-lock & calculate a position for that axis?

I have a theodolite-like device that is trying to track a point such that it's "Forward" is always facing that point. Here is a GIF of it working as of now. As expected, when the value of the Red ...
0
votes
0answers
21 views

Rigid body dynamics : how to check if result is physically correct

I implemented rigid body dynamics according to this guide. And it kind of works. However I'm not entirely sure if the dynamics is correct when angular momentum is not collinear with axis of inertia ...
0
votes
1answer
128 views

OpenGL vector rotation matrix to a given point

I have a sphere with a radius of .5 The sphere is centred at 0,0,0 I am now trying to place items around my sphere based on a given x,y,z on the surface of the sphere. My items have been draw/...
2
votes
2answers
78 views

Unity c#: How to slow down rotation over time?

I am making a space combat game, in which the player can press q and e to roll their ship. I did this by adding torque to the rigid body when the player press q or e. However, after they do so, they ...
0
votes
1answer
190 views

GLFW - Camera rotation system

I need to make a camera rotation system similar to the one here http://madebyevan.com/webgl-path-tracing/ To rotate, press the Left mouse button and drag. So far I figured a basic idea of how this ...
2
votes
1answer
117 views

Unity move Vector3 position with transform

How can I move a new Vector3 position with a Transform? Like the transform is the parent the vector. Example if I want to push the x position for example by 10 value and I rotate the transform its ...
0
votes
1answer
104 views

Using PyOpenGL, can I rotate raw data rather than the current matrix?

I'm trying to create a sort of PyOpenGL renderer for the Bullet physics engine, and at the moment I'm rotating my basic cubes with math in Python. However, if I do the math in Python that's going to ...
0
votes
1answer
107 views

Unity 2D Tap to shoot at mouse position on android device

Hello everyone i am really stuck at the moment and would appreciate any help if possible. I have my game where i move the player up and down with 2 buttons on the bottom left of screenshot. I also ...
1
vote
1answer
97 views

Follow Player which moves over a sphere

After hours of googling and pulling several hairs out, I decided to open this thread. I want to make a game, in which the player walks around a sphere (like super Mario galaxy) and the camera should ...
1
vote
1answer
84 views

Why use gimbals?

With all the gimbal lock problems, quaternions, and stuff like that - why do we even use gimbals for rotation? Why not use local rotation instead of gimbals?
1
vote
1answer
40 views

How to rotate an object to a specific transform?

I am working on a car racing game and there are some times when the car rotates and ends up on its roof. On those situations I want the car to respawn on the same location. What can I do to rotate it ...
1
vote
2answers
34 views

Rotate A towards B with limited turn rate

I want to rotate A towards B with a fixed turn rate per second. My math skills are very limited and I have no clue in how to accomplish this. Best Regards
1
vote
1answer
47 views

How to Work With Arbitrarily Oriented Vectors

I'm brushing up for a pending game jam and just for kicks I thought I'd let the gravity in my 2D platformer push at an arbitrary angle. Normally gravity points downward (3 PI / 2), but if I wanted it ...
0
votes
0answers
65 views

How do you rotate a Unity gameobject with the device's gyroscope?

I currently have a gameobject placed atop a wedge as in the image below: I want to make the user have to rotate their device to keep the rectangle balanced upon the wedge. Here is the C# code I have ...
0
votes
0answers
20 views

Rotating Weapon with mouse.position even on UI Buttons how can i fix?

When i rotate my weapon using world space this works and looks great, but when i go on my android device and i am moving my player up and down with UI buttons my weapon rotates towards my UI Buttons ...
0
votes
1answer
33 views

Calculate quaternion rotations between two values

I have a quaternion Q1: X: -0.023995593190193176 Y: -0.4076451063156128 Z: 0.04357096180319786 W: 0.9117847681045532 and I have a keyframe value Q2 which is based on Q1: X: 0.176469 Y: -0.368251 Z:...