# Questions tagged [rotation]

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

193 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
368 views

### Blend Tree animation problems at rotation

I have a Blend tree animation with two floats ( VelocityX, VelocityZ) that have idle, run , run right, run left , I use a pad to move it at world space When VelocityX is -1 it run left, +1 it run ...
• 293
4k views

### Arcball 3D camera

I have checked multiple threads before posting, but i havent been able to figure this one out. Ok so i have been following this tutorial, but im not using glm, ive been implementing everything up ...
50 views

### Spritebatch drawing the other way

I am drawing a rectangle using a emptytexture (1x1) and I use the following: ...
390 views

### Quaternion.LookRotation on z-up gameEngine

I'm trying to implement a look rotation method, similar to Unitys one, but with the difference that in Unity, Z is forward, and in my engine, Z is up. I have an implementation where Z is forward, and ...
• 59
790 views

### How to keep track of camera's rotation while it's being rotated?

I'm building a 2D game where the sole interaction of the player is rotating what they can see (this is currently the camera, though it could be the world) by plus or minus 60 degrees. My current ...
• 176
92 views

### Calculate Up Vector of Object on Surface Given Points and Normals

Context I want to find the up vector an object would have if it were leaning on a surface, given a large amount of points on that surface and their associated surface normals (i.e., an equation that ...
• 21
69 views

### Aligning vector by rotation around non-orthogonal axis

This is almost more a geometry/mathematics question than a game dev one, but I think I'll have a better chance actually understanding the answer if I ask here. Rather than try to explain it- because ...
• 163
61 views

### Can you interpolate statelessly?

I was just wondering if it's possible to to a linear interpolation between two rotations without maintaining any kind of state. What I mean is let's say I have a loop function where all my code is ...
• 75
896 views

### Limit rotation angle

I am currently trying to rotate the weapons of a spaceship towards the mouse position, but in order to avoid the collision of projectiles with the ship I want to limit the angle the weapon can turn. ...
• 85
449 views

### How to calculate a quaternion rotation between 2 vectors with a specific final up vector?

I know you can calculate the quaternion rotation between 2 vectors with something like this after all the optimizations: ...
705 views

### Quaternion - rotating rigidBody to particular angle over time

Using Bullet Physics. There's a rigid body that is rotated. For some delta-time I need to rotate that body to have rotation of (0, y, 0) - keep the old y value rotation but reset x and z. The ...
• 121
56 views

### Xna 4 Model Rotation with inertia not working as expected with variable updates

I am trying to rotate a model with inertia damping with the keyboard. The code works great with a fixed time step but it doesn't behave the same with a variable update frequency. Update method: <...
1k views

### Rotation of viewplatform in Java3D

I have just started with Java3D programming. I thought I had built up some basic intuition about how the scene graph works, but something that should work, does not work. I made a simple program for ...
• 143
1 vote
38 views

### Quaternion.Euler acting weird

so I'm building up a simple arcade racing game and I was messing around with the Wheel Colliders setup. I was wondering if it was possible to add some camber adjustments in real time depending on the ...
1 vote
21 views

### Pan orthographic non-axis-aligned camera

I'm trying to create a panning control for a camera in bevy, but I can't seem to get the panning logic right when the camera is rotated. It works fine if the camera transform is directly facing the XY ...
• 111
1 vote
52 views

### How to calculate a direction vector from a 3x3 rotation matrix?

I have a dataset containing 2D images of telco towers and metadata. Each 2D image has 3x3 rotation matrix which provides orientation info about the drone when it captured the image. Now I have a 3D ...
1 vote
130 views

### In Godot, how do I reposition the center of my mesh?

When importing a Unity package to Godot via Unidot importer, I noticed that a few imported models have their child rotations and transformations off-center from their expected points. For example, ...
1 vote
39 views

### 3D transform hierarchy rotation applied in wrong order

I'm following in the footsteps of this blog in implementing a transform hierarchy to my game engine scenes. I have a fairly similar implementation for a 3D transform: ...
• 11
1 vote
105 views

### How to set pivot point for rotating a sprite?

Is there a way to set the pivot point for rotating a sprite? The default option seems to be arbitrarily chosen point on the sprite or the mid point. ...
• 111
1 vote
39 views

### How to throw an object using a rotating arm controlled by the player?

Apologies in advance for my lack of knowledge, I am very new to 3D My goal is relatively simple. The player controls an arm and uses the mouse to rotate it around a point. They can hold the mouse ...
• 11
1 vote
325 views

### How do I use Transform.RotateAround to gradually rotate my GameObject around a new pivot in the shortest direction?

Given a normalized Vector2 or eulerAngles.z, I'm trying to gradually rotate a 2D box around a new pivot (the top of the box) ...
1 vote
101 views

### Calculate 2d rotation to target (uniformly accelerated rotation, constant speed)

I'm trying to calculate an uniformly accelerated rotation for the autopilot module in my 3d space game shooter. The autopilot should fly the spaceship to any given point in the 3d space on the ...
1 vote
567 views

### How to correctly rotate object using clamping and euler angles?

I've a player (a space-ship ;) that can rotate from -x to +x value (so clamped). So, before apply rtoation i check it: ...
• 437
1 vote
205 views

### Forward movement while rotating lead to flickering

I'm trying to make a ship move forward while also turning, but when I start to play, the ship flickers when it tries to move and turn at the same time. (as comments suggested, I added other code for ...
• 173
1 vote
190 views

### Player rotation recalculation causes jittering on edges

When my player walks around a circular planet everything works well, but when my planet is a shape like a cube or a dodecahedron, even with smoothed edges, my character jitters if I walk slowly on the ...
1 vote
290 views

### Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
• 11
1 vote
75 views

### How to create a joint, where the rotation of one object is relative to the other?

I would like to create a top down view scene, with one rectangle (top) is on top of an other (base). There is a joint, where ...
• 277
1 vote
186 views

### Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist is as follows: ...
• 23
1 vote
861 views

### How to rotate a rigidbody with a Pid controller

I would like someone to describe me how to use a PID controller to rotate a rigidbody with AddTorque to a specific position. (like a spacecraft that rotates the Y axis of rotation towards Camera....
1 vote
60 views

### Adding vectors and applying rotation matrix using quaternion

I have a problem and looking for help, see attached image. I have a number of points (x,y,z) which are treated as connected vectors (first point as first vector base, second point as first vector end ...
1 vote
823 views

### How to make a top down 2D ball rolling

I am developing a top down game similar to 8 pool billard with libgdx and box2d. How do i make a 2d ball texture look like its rolling when force is applied like this: So it feels actually 3d ? For ...
• 121
1 vote
466 views

### How to calculate the torque required to rotate rigid body about constant axis and rotating axis?

How to calculate the torque required to rotate rigid body about constant axis and rotating axis? Convention: Identity Rotation Matrix: ...
• 11
1 vote
38 views

### Polygon doesn't bounce enough in edge-ground collisions (but it does in vertex-ground collisions)

I'm currently making a (basic) physics engine in Python in which I want a polygon to bounce off the ground ($y=0$). When a vertex hits the ground, I apply the (linear) impulse \overrightarrow{P}...
1 vote
115 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 ...
1 vote
42 views

### Switch Vector 3 x,y,z Components Based on Rotation

I have a cube that moves by rotating on its edge. I want my code to also work for cuboids. The following code is what I'm using to rotate my cube: ...
1 vote
722 views

### Rotating RigidBody2Ds in Godot

I am practising programming games with the Godot Engine and I've been having some issues with RigidBody2Ds. In this case I have a ...
• 143
1 vote
918 views

### How should the physics be on an halfpipe like in a skate game in Unity?

I am making a inline skating game. My player is skating based on the normals of the surface of the ground. But when I skate up a halfpipe it flies in the Air but doesnt comes down like it should be, ...
• 141
1 vote
836 views

### SceneKit-Convert a rotation vector into rotation matrix

I'm very new and I'm studying this ARKit code from RPasecky/CubesInSpace on github where he/she convert the point of view 's rotation vector into a rotation matrix ...
• 111
1 vote
341 views

### 3D Flight with pure local rotation without roll creep

I'm working on a flight race game with a specific constraint and cannot find a solution. Hereinbelow, an image of a test scene. My ship has a cylinder (children) in front of it from which I get a ...
1 vote
1k views

### Update the UI Rotation According to camera rotation

I have a camera which is showing the userInterface (canvas) object into the front of my camera. I am only updating my userinterface position if the camera raycast is not hitting my userInterface ...
• 2,054
1 vote
266 views

### Issue calculating new angle for player to look at some 3d world object

I am working on a Unity game where the Euler angles of the player display some weird behaviour that I cannot understand. There seem to be two full 360 degrees rotations, one positive and one negative. ...
• 121
1 vote
1k views

### Rotating an object around it's centre in OpenGL

I'm writing small 3d viewer of models from .obj file. I have a car and I want to rotate car's wheels. I found a lot of good examples but I still have a problem: wheel rotates around point at the it's ...
1 vote
224 views

### Reconstructing 3D Rotation from 8 byte - Assistence required

I am currently trying to load 3D models and animations into a program. The file format has no public description, so I am decoding them piece by piece. (I'm studying computer science and it's for ...
• 131
1 vote
170 views

### How to Rotate a Circle Around Its Own Midpoint

I have rendered a circle using OBJ file. Now I want to rotate it around its own axis, like YouTube buffering icon. How can I do that? I'm working in OpenGL. I can change its x, y, and z rotation ...
• 11
1 vote
1k views

### how to properly rotate in directX11

I am trying to Rotate a textured quad in directX however I think i am missing something. I am pretty sure it is because i am applying transformations to the WorldMatrix instead of the ObjectWorld, ...
• 11
1 vote
106 views

### Fixing wave-like movements when rotating an object using mouse input in Unity

I have encountered a rather odd issue with my program. The setup: In my scene, I have a GameObject which I have set as my player/character for this game. The player/character has a child GameObject, ...
• 11
1 vote
340 views

### Rotation of a point around axis using quaternions

I have a simple processing program to rotate a point around arbitrary axis but it stops after a bit. I'm trying to get full rotation of the point around the axis. ...
• 111
1 vote
843 views

### OpenGL ArcBall Camera

I'm currently working on a OpenGl Project and I have alot of difficulty understanding how arcball camera work. From what I have read online, all I have to do is to rotate a camera around a target and ...
1 vote
1k views

### How to programmatically create an animation that linearly interpolate between two rotations?

I would like to programmatically create an animation that linearly interpolate between two angles (using the shortest path). I wrote the following code : ...
• 3,214
1 vote