# Tagged Questions

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

18 views

### How to make one 3D object face another?

I'm writing a simple 3D engine myself and I cannot figure out how to make one object face another. The problem begins with identifying which direction the target object is in relation to the second. ...
20 views

### Which is better between animaion and Script for rotation

To Rotate a particular object in unity, which way is better? Rotating it by animation or by applying rotation from script.
161 views

### Jittery Rotational Movement with Arcball implementation

I have an assignment where I need to implement arcball using Opengl (~2.0). I have it more or less implemented but I have a some problems/issues/bugs and I'm not sure whats either causing them or how ...
80 views

### Rotation Continuity help

First the issue im having: Basically its the fact that the angles of a circle aren't continuous, they rise from 0 to 2pi then immediately fall back to 0. I want to make a game where the player ...
61 views

### Check collision between two rectangles - libGDX

I'm making a game in which the objective is to collect the maximum amount of balls(Rectangle) to get the highest score. The balls spawn randomly from the middle of every side of your smartphone, and ...
81 views

### Help With Rotating Turret and Muzzle Flare Sprites

I am making a top down game that involved tanks rotating their turrets and firing at other tanks. I have the turrets rotating independently of the tank itself about the center. However, I am now ...
21 views

### Wrong pivot point of parent / wrong scale of children

I'm trying to make two objects, in is an intact glass, the other one is the glass but shattered. So for the shattered glass, in Maya I make a Plane, cut it with the multi-cut tool, extrude the faces, ...
115 views

### Unity Animated Player Character Rotation Glitch

I was wondering if anyone experienced this issue in Unity with Mecanim-animated characters ... I have an animated player character with a third-person camera control (Game Camera from the asset store,...
47 views

### Unity Rotation - Object is rotating on Z, but should be rotating on X

I've been working on a project where I have a cube. When swiped left, the cube will rotate 90 degrees the left, and then when swiped right, the cube will rotate 90 degrees to the right. I have this ...
56 views

### libgdx sphere rotation after movement

I'm moving my sphere on the screen using this method: Matrix4 m = myBall.body.getCenterOfMassTransform(); Vector3 translation = new Vector3(); m.getTranslation(translation); float multiplier = delta ...
36 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, ...
65 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 ...
51 views

### BulletPhysics ship rotation

First of all, I'm a beginner in game physics, and I think this is a relatively easy problem that I'm not grasping. Short Version: I have a box(representing a ship on water) going forward with a ...
287 views

### Rotate arrow without using Unity3d physics engine

I have this code that simulates the movement of a projectile without using the unity physics engine IEnumerator LaunchProjectile(int angle, float speed) { // Move projectile to the position of ...
106 views

### Euler adjustments between two quaternions

I have two quaternions, q1 and q2. If my object's current rotation is at q1, but I need to get it to q2, what would be the process to figure out how much rotation I apply to x, y, and z in order to ...
160 views

### Increment grid by rotation

I'm currently working on a grid for snapping objects side by side. My current script is working fine, but only for game objects which haven't been rotated. Here is an example video of the problem: ...
319 views

### Gradual rotation of an object in Java

I'm using Java to learn some movement algorithm. I would like to implement the "wandering" algorithm, but in order to do it, i should understand how to rotate an Object gradually. Actually, my Player ...
1k 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 ...
45 views

### Rotate directly towards a target at a constant speed

I've written a program (see on JS Fiddle) that rotates my player towards the mouse cursor at a constant speed. I've computed the angle to the point using the Math.atan2 function, but when incrementing ...
43 views

### Moving along the surface of a mesh?

I'm trying to replicate the movement in this game: https://www.youtube.com/watch?v=OcvD8BXars8 The players ship along with all other game elements move along the surface of a mesh. I've tried ...
537 views

### Jittery Movement, Uncontrollably Rotating + Front of Sprite?

So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math. Now I'd like it to rotate and face the mouse as ...
154 views

### Rotate sprite along the angle between two objects

Im trying to make flames follow my object, I set the direction for my moving object using the points between it and another object (using static destination for testing). No matter what I do I ...
330 views

### LibGDX make an object rotate around something

I need to rotate and object, which should be a circle made up with a ShaderRender, around a specified point. In LibGDX there is a method or something which allow me to do this? If it doesn't exist how ...
1k views

### How do I determine the look-at vector of a free-look camera?

I'm trying to create a free-look camera with DirectX 10. I've figured out how to get the directions for forward and back and left to right. However, I don't know how to rotate the look-at vector of ...
5 views

### Cocos2d How to get Smooth rotation of sprite when using Sprite->setRotation()

i have simple round circle joystick when i move the thomp on the circle joystick it moves simple sprite so when i get for example 40 Degress in the joystick i set the sprite setRotation(40) all this ...
230 views

### How do I ADD gravitation to a rotation matrix?

I have ported the Matlab script from https://instruct1.cit.cornell.edu/courses/bionb441/LSystem/ to POV-Ray and everything works fine (although I'm not quite sure why). To navigate a "turtle" through ...
26 views

### What is a good practice for deciding when to use transforms instead of applying force?

I was making several games. I don't understand when I should use addTorque instead of rotate. AddForce instead of position The latest game was a pinball game. I wasn't sure the best way to active ...
663 views

### In UE4, how do I turn my character's body together with the camera?

I made a simple punch animation in Blender and exported it into Unreal Engine 4. In-game, the character appeared from a 3rd-person perspective, but I made it look like first-person by adjusting the ...
13 views

### camera rotation animation problem

I would like to create a 3d person rotation where the camera rotates to the character rotation(follow camera which orbits around the character). It might be possible that the character rotation ...
31 views

### Position camera in opengl

I have a camera with a 3D vector that represent the position and a quaternion that represent the camera orientation. I'm trying to rotate and orientate the camera correctly, but I can't. I know that ...
1k views

### How to make my 2D character stand normally on slope?

I've got this character in Unity3D (2D Mode)... in a a slope which looks like this, But I want the character to stand along the red line..Like below How can I make it in Unity3d? I've got this ...
47 views

### How to calculate a simple swivel rotation? (no physics engine)

Assuming i know the geometry and the rotation angle of a cart, how can i calculate the rotation angle of a swiveling wheel? To get the rotation angle of the wheel, i tried by calculating the ...
20 views

### Rotating a UI arrow according to the change in camera's rotation

I have been trying different alternatives to do what is a very basic thing but I couldn't have any success. What I want to do is this. I have a 2D UI sprite at the screen, formed by 2 triangles, with ...
25 views

### Rotate camera with quaternions

I have a camera with a 3D vector, the position, and a quaternion, the orientation. I'm able to move the camera in a realistic way (respect the local axis) but I can't do the same with the rotation. ...
43 views

### 2d vector flips during rotation

I have a 2d game (C++ and SDL) and I want the player object rotate to follow the mouse. The player object and the mouse location are both stored in 2d vectors. In order to have the player's rotation ...
89 views

### libgdx limit angular speed

I'm working on my top-down game. y characters use pathfinding + steering behaviors(Arrive and FollowPath) to move. I've implemented my character class from libgdx SteeringActor class (from tests). So ...
2k views

### Libgdx Do a fixed rotation for orthographic camera

I'm trying to rotate my OrthographicCamera in the render loop to a fixed angle, but I can only make the camera spin. This is the code that I have: in create(): OrthographicCamera camera = new ...
34 views

### How do I rotate enemies on NavMesh in Unity?

I have a NavMesh Script for my enemy but it just looks into my direction and if I run around him he is still looking in one direction and not turning and facing me, how can I rotate him in the script ...
100 views

### How can I min-max quaternions?

What I'm doing In my engine, I'm trying to implement a camera that will follow a target object, such as a player. I wanted to avoid just simply using the inverse of the target's transformation, ...
46 views

### 3d rotation of a cube using DirectX

I can't solve an apparently simple problem: i have a cube, similar to the one in the following picture I've tried to write a small demo where i can rotate the cube by dragging the mouse, but i can'...
72 views

### Problem with Quaternions and Unity's Euler Angle Convention

So I want to rotate an UI-Element according to my magneticHeading, I just want to apply the magnetic heading to the z rotation in EulerAngles. So I tried to do so, which brought me to some weird ...
42 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. import org.apache.commons.math3....
37 views

### How do I allow my player object to continue rotating once it's met a clamped boundary?

I have a spaceship I'm moving around on the screen, when the player moves the ship, it rotates on its axis. However, when the ship meets a clamped boundary(on the x-axis) it abruptly stops. How do I ...
40 views

### Roatating a Game Object downward

In my game I have a rocket which is traveling horizontally across the screen. What I am trying to do is when the player runs out of fuel, the rockets engine stops (already coded) and then the rocket ...
161 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 ...
95 views

### Unity3D - Smooth rotation for seek steering behavior

I am trying to implement Reynolds' seek steering behaviour, but I am having problems on the rotation part. This is what I have: void FixedUpdate() { // get position of current waypoint ...
35 views

### Calculating a matrix to have the model follow terrain

So I've been messing around with 3D graphics in Java (using lwjgl), and I've hit a bit of a roadblock. I have a heightmap and a cube, and I want to find a way to have the cube rotate to follow the ...
46 views

### How to create a linear plateform between two points?

I have a set of 2D coordinates. Their positions are regular on the X axis, but unpredictable on the Y axis: I would like to create slim platform between each point in order tu use it as ground for ...