Stack Exchange Network

Stack Exchange network consists of 175 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
26 views

How can I rotate my character so that he is facing the mouse?

I just want to preface this by saying I am very new to pygame. At the moment I have calculated the angle that I need to apply to my character so he can rotate but I am unsure how to actually make ...
1
vote
2answers
40 views

Rotate on one axis, but visibly keep the other axes stable and editable

It's been a long two weeks. Quaternions are freaking complicated. I've managed to make a few baby steps towards finishing my project, but I've hit a brick wall and could use a few of your beautiful ...
0
votes
1answer
27 views

How to calculate/structure/define rotation vector for OpenGL / WebGL

I am trying to define the buffer data for WebGL and want to have in there something that encodes the fact that an object might be rotating. So it makes me think of angular momentum. So if you have ...
0
votes
1answer
29 views

How do i make enemy tank to follow and face player tank?

I'm creating tank game demo , in game i want enemy tank to always face toward the player tank. I already check look_at() function but it will face immediately, i don't want that. I want enemy tank to ...
0
votes
1answer
33 views

Z rotation matrix inverting object

I'm currently creating a 3d game where I need to rotate shapes. To do se, I created a rotation matrix for each axis, X, Y and Z. X and Y are giving me expected results, but not Z who kind of "inverts ...
0
votes
1answer
16 views

Rotate an object smoothly by using Accelerometer Input in Unity

There is a simple script where the object orientation is equal to the mobile devices orientation. it works but the object doesn't rotate smoothly. ...
0
votes
1answer
14 views

Issue with script recognizing particular z-axis rotation angles in Unity

I'm trying to make a simple flowing pipe-style rotation puzzle, but having issues getting Unity to properly recognize certain angles of rotation. My rotation script for the pieces: ...
0
votes
1answer
25 views

How to rotate CharacterController on slope

I'm trying to rotate my characterController player on a slope on the 'x' and 'z' axises, however things aren't going so well. The player does rotate, but if I move and look in another direction, the ...
0
votes
1answer
41 views

Handedness of 2D coordinate systems

I know that there's always a big debate on the handedness of 3D coordinate systems, but I can't seem to find any information about the handedness of 2D coordinate systems. Usually, the X axis points ...
1
vote
1answer
72 views

Unity3D: Replicating SM64 turning movement into Unity

Brief Summary: I want to recreate Super Mario 64 turning movement into unity without the clunky movement I currently have. And I would also love how to implement the camera rotation system mentioned ...
0
votes
1answer
68 views

how to get if a rotation/position has been completed?

I've done an if / else with the final position / rotation plus they never complete, how can I check this? stays like this https://i.imgur.com/3cQ9AEk.gif ...
0
votes
1answer
33 views

In 2D, how can I improve character rotation using raycasts when dealing with sharp/convex edges?

Edit: After making some edits to my polygon collider (based on @Alex F's suggestion), I can indeed confirm that sharp, convex corners are causing the buggy ...
1
vote
0answers
22 views

How to convert a rotation around an axis into pitch and yaw rotation

So i want to rotate particles towards a point and i've already figured out how to calculate the angle and the rotation axis. Currently what i do is simply use a 3 dimensional matrix, apply the ...
0
votes
0answers
19 views

how do I instantiate something with only the y axis rotation matching the instanciators y rotation

i'm making a swimming mechanic for my game and i need to instantiate the swim camera under neath the fps player when it hist the water. no mater what I try the swim cam wont have the same y rotation ...
0
votes
1answer
31 views

how do I move an object based on rotation of another object?

This question is related to my other question about camera rotation. I hope its acceptable to ask a second question. I cannot figure out the math of how to calculate moving the camera to stay behind ...
3
votes
1answer
77 views

Why does my collider rotate correctly on a slope only when a ray is cast directly from its center?

Edit: This answer might also be helpful to those who come across this question. I've been messing around with raycast collisions and slopes, but am having an issue when trying to get my collider to ...
0
votes
2answers
22 views

RigidBody.MoveRotation Resetting to (0,0,0);

I'm trying to rotate a character on along the y axis but rather than continuing to rotate, it rotates then the y rotation goes back to 0. I'm not sure what I'm doing wrong. The same thing happens if I ...
0
votes
0answers
28 views

Need Root Motion For Gravity, But It Affects Rotation?

I have a little animated character in my game with multiple animations. In order to have gravity affect him, I turned on "Apply Root Motion" in his animator. Now one of his animations won't rotate ...
0
votes
1answer
36 views

Move a point to another, along an elipse

according to this picture, I want to move my yellow object, smoothly to the red one. And I want to have an eliptic trajectory in relation to my center point. So for now I'm having this code: ...
-1
votes
1answer
53 views

Rotation Problem in Mario galaxy like controller [duplicate]

i'm doing a Mario galaxy like CCC. And I have a serious rotation problem, may be Gimble lock, or maybe not. So first, I have a parent object ("PLAYER") who can rotate toward a planet: https://youtu....
0
votes
1answer
29 views

Unity smooth local rotation around one Axis, oriented toward a target

I want to acheive the same rotation you see in the inspector. In short: a smooth local Y rotation, toward a target I have a Vector3 orientation: ...
0
votes
1answer
40 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
45 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
33 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
33 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
13 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
1answer
37 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
33 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
18 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
63 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
57 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 ...
1
vote
1answer
49 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
37 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
35 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
136 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
53 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
1answer
80 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
38 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
269 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
28 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
31 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
37 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
1answer
53 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
230 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
237 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 ...
1
vote
1answer
381 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
148 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
31 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
75 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 ...