Questions tagged [rotation]

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

123 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
2answers
3k views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
4
votes
1answer
909 views

Why is my model rotating opposite direction around the Y axis?

I have a simple scenario. I have a simple scene, and in it I'm drawing a grid and a model, with some axis for orientation. I noticed when I rotate the model about it's local Y axis, if I rotate the ...
4
votes
0answers
279 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 ...
4
votes
1answer
753 views

How to correct this issue with a top-down aiming angle in Unity - 2D?

I'm trying to build my first project and I'd like some input for a math correction. The game is a top down 2D shooter, a bit like the iconic "chaos engine" from SNES. The issue is that either the ...
4
votes
0answers
3k 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 ...
3
votes
1answer
142 views

Pitch becomes yaw as camera gets near object

I have been having trouble with my camera, first encountering the roll tilt that is so many times asked... I fixed that issue by following the instructions at this link: Unwanted roll when rotating ...
3
votes
0answers
244 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 ...
3
votes
3answers
415 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 ...
3
votes
0answers
373 views

Why is my 2D mouse aim not working properly?

I'm trying to program 2D mouse aim, where the arms and the gun in the arms rotates to point at the mouse. But for some reason, the arms and gun rotate and do not follow the mouse position. The each ...
3
votes
3answers
616 views

libGDX - How to rotate with a specific duration

I want to rotate my player to 90° for a specific duration. I know scene2d provides this, but I don't want to use it for my players. With how much to rotate every frame, so after x seconds the ...
3
votes
1answer
410 views

AS3 move object to a point

I'm trying to make a room full of monster each side and the player stay in the middle. I have a problem, I don't know how I move each monster to the player and rotate each of them to face the player, ...
2
votes
1answer
56 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. ...
2
votes
0answers
276 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: ...
2
votes
0answers
527 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 ...
2
votes
0answers
54 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: <...
2
votes
0answers
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 ...
1
vote
0answers
42 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
0answers
100 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 ...
1
vote
0answers
65 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: ...
1
vote
0answers
27 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
3answers
221 views

How to accurately capture the direction in which the mouse moves?

I used to play this game on Kongregate called Death vs Monstars. A tl;dp (too long; didn't play) explanation of the mechanics is that the character you control follows your mouse cursor. Your ...
1
vote
0answers
34 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
0answers
31 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
0answers
414 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 ...
1
vote
0answers
425 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, ...
1
vote
2answers
1k views

How to move a player along Waypoints with Rigidbody.MovePosition in Unity?

I have a player with a Rigidbody, I want it to follow along the Waypoints. I have used MoveTowards but it seems also not to work however. I want to use MovePosition to add force while grinding. I ...
1
vote
2answers
2k views

How to rotate a local position offset based on a direction vector?

I'm trying to fire three raycasts in the direction of movement, from offset starting points. I'm having trouble calculating the start positions of the rays based on the direction. As you can see in ...
1
vote
1answer
193 views

Calculating real time moment of inertia around arbitrary axis in 3d

I have a 3d rigid body consisting of multiple triangles forming a closed mesh. I know how to calculate the moment of inertia around an arbitrary axis by splitting up the mesh into simpler shapes and ...
1
vote
0answers
464 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 ...
1
vote
0answers
298 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
0answers
666 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 ...
1
vote
0answers
181 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. ...
1
vote
0answers
660 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
0answers
92 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 ...
1
vote
0answers
138 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 ...
1
vote
0answers
719 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, ...
1
vote
0answers
71 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, ...
1
vote
0answers
286 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. ...
1
vote
0answers
581 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
0answers
101 views

Translate D3DXMatrixLookAtLH to Unity compatible code

I am currently trying to port a really old Game (I have the source of it) to Unity as a fun project. And I'm currently stuck with the object rotation techniques in Unity compared to the ones used in ...
1
vote
0answers
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 : ...
1
vote
0answers
197 views

How to find or compute or look for overall/max RPM by simply checking for rotation?

I find it hard to determine the wheel RPM since I'm only making a simple 2D game of rotating object via Z-axis. I wanna try this solution but I got no change since I'm trying to find the RPM from a ...
1
vote
0answers
48 views

Can I “Pre-rotate” VBOs while loading them in LWJGL?

It is possible to flip VBOs horizontally and vertically by swapping around destination coordinates. Is it possible to rotate an image by any angle, such as 45 degrees, using different destination ...
1
vote
0answers
923 views

Hinge joint annoying wheels rotation in Unity

I try to made a little skate game prototype in Unity 5 and I just encountered an issue. I added a hinge joint between the board and each of the wheels couples (front and behind) so the board can move ...
1
vote
0answers
549 views

Why does rotating a polygon also translates it in libGDX?

I'm using polygons for collision detection. Here is the code: ...
1
vote
0answers
18 views

CanDraw in large hierarchical scene with rotation

I've been assigned to write small simulation visualization, that contains thousands of cubes (I know you heard that before). Now I'm working on optimization of stuff that takes place there, but ...
1
vote
0answers
622 views

How do I implement realistic recovery from weapon recoil?

I want to create an equation determining how fast a gun recovers back to its center after it has fired. I have a weapon system functioning based on constants (recoil amount, bullet spread, etc.) ...
1
vote
0answers
86 views

Unintended twisting of geometry while generating a mesh?

I am creating a real time animation of tori (toruses), and I've run into a problem where at certain angles of my tori, the geometry is twisting up where it should remain straight. Here is an animated ...
1
vote
0answers
131 views

Is there a way to rotate an Ellipse in libGDX for collision detection purposes?

I'm trying to avoid having multiple overlapping Circles for a UFO-shaped sprite. Two Ellipse objects will perfectly cover the shape of my UFO, but I want to tilt/rotate the UFO when flying left and ...
1
vote
0answers
977 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 ...