# Tagged Questions

Mathematical constructions, number systems. In 3D-graphics quaternions are used alongside vectors and matrices. One of the benefits of quaternions is that they overcome some rotational problems (known as gimbal locks) that are inherent to vectors and matrices.

59 views

### Quaternion based camera pitch freaking out, and Z-axis drift

This is the code I use to control my (first person) camera's movement and rotation. Translation successfully keeps orientation in mind, so that up and left and such are always in the expected ...
100 views

### Applying angular velocity to quaternion

I am reading Game Physics Engine Development by Ian Millington currently. In his book, he represent an orientation of rigid body by quaternion. I don't understand the formula where he apply angular ...
172 views

### Correct way to integrate scaled axis angular velocity into a quaternion

Across my travels on the internet I have came across to ways of integrating a scaled axis angular velocity into a quaternion. The first way converts the angular velocity into an axis angle quaternion ...
155 views

### Quaternion.Lerp not working properly in Unity3d

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate with only 5. Any thoughts please? ...
1k views

### How can I create a WebGL camera based on quaternions?

I am trying to create a WebGL camera based on quaternions. I looked at many tutorials, and none is as simple as it could be or it was not working. How can I create such a camera?
127 views

### 3D 3-axes rotation into 3D 2-axes rotation

Hello everyone and thanks in advance to anyone who'll help me through this ! I am currently working on the Kinect V2 (for XBox One) to interact with an avatar. I'd like to use the rotation quaternion ...
268 views

### How do I create a view matrix directly from a quaternion and a position vector?

Given a quaternionic camera such that: typedef struct { vector3 upReference; vector3 rightReference; vector3 forwardReference; vector3 position; quaternion orientation; ...
306 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 ...
532 views

### Quaternion to direction vector - flipping

I've kinda solved this myself by adapting the Camera::setDirection code from OGRE to work for my need: Now I have the following code: Vector3 boneDir = getBoneWorldOrientation(mEntity, mHips) * ...
29 views

### Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
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....
32 views

### align local Y to be parallel with global Y during or after slerp

I am using the following function to have a globe rotate a point on its surface to face the global Z toward the camera. This works fine, but after each rotation the Y axis seen as a green line is not ...
49 views

### Interpolate camera rotation over many keyframes smoothly

I have a defined set of rotation/position keyframes that I want a camera to animate between smoothly. Handling the position is easy enough using cubic bezier curves (and just auto-generating the ...
120 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: quat quat::fromtwovectors(vec3 u, vec3 v) { vec3 w = cross(u, v); ...
48 views

### Quaternion camera in 3D space with Pitch and Yaw

I am having trouble implementing a quaternion camera that can fly freely in 3D space with only Pitch and Yaw rotations. It works fine except when you look up or down and then try to look left or ...
116 views

### Matching the 3ds max camera view in my game 1:1

I want to match 1:1 the 3ds max camera render with my 3d engine (DirectX 11, C++). I believe that my mesh exporter (coded with MaxScript) works fine, I see the right shapes. But something about the ...
649 views

### How to align angular velocity wit target rotation in 3D?

I'm making a space crew sim (controlling a ship) and have recently posted a question about how to calculate ETA between two rotations. I how now a new question more well defined. Background: I have ...
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. ...
33 views

### Camera movement on a sphere, and how to look while doing it

I am trying to make some kind of pointerlocked walking simulator that involves movement of the camera on the inside of a sphere. I've looked at Walking on a sphere, but that solution fights what I'm ...
34 views

### How to rotate with quaternions

I need to simply rotate around an axis, but because unity uses quaternions for calculating i have issues with converting into euler angles. When i ask for rotation of an object in euler angles it ...
52 views

### How to get correct quaternion value from real world to screen?

I'm writing an application (not a game per se, but close enough) where we use attitude sensors (an IMU) in the real world to affect the orientation of an object in the application's 3D space (OpenGL). ...
104 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 : Animation anim = gameObject.GetComponent<...
115 views

### Translation & Rotation Transform Hierarchy

I've struggled to find a hierarchical transform class in C++ that is similar to that of Unity's (without scaling) that uses quaternions as opposed to matrices. So I figured creating my own wouldn't be ...
599 views

### Rotate model to face direction it's traveling in 3d with scenekit and swift - Boids implementation

I am implementing a boids simulation using Swift and Scenekit. Implementing the simulation itself has been fairly straight forward however I have been unable to make my models faces the direction they ...