# 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.

1answer
421 views

### Quaternion to axis-angle, or ripping apart a full transform matrix

My game entities currently hold a quaternion for their orientation with the ability to return either a 3X3 full rotation matrix (based on that quaternion), or a full 4X4 transform matrix. though what ...
2answers
2k views

### Quaternion rotation

I have a problem understanding quaternions rotation in OpenGL. So far I have implemented all function and operators related to quaternions.They are definitely working right!. However I can't find ...
5answers
9k views

### Rotating vector3 by a quaternion

I am attempting to rotate a vector3 by a given quaternion. I know that this is true v' = q * v * (q^-1) I know that q^(-1) is the inverse which just -q/magnitude(q), but how do I map the ...
0answers
475 views

### Setting Orientation of Character in Bullet/Ogre [closed]

I've been suffering from an issue regarding the implementation of orienting characters in a game I'm implementing using Ogre3D and Bullet physics. What I have: A Direction Vector that the character ...
1answer
1k views

### Rotating a vector by a quaternion

I am trying to rotate a direction vector (0,0,1,0) by a rotation quaternion in DirectX. From what understanding, to rotate the vector you must do NewVector = rotQuaternion * Vector * inverse(...
2answers
2k views

### Calculating a quaternion so a bone points in a specified direction

In an attempt to solve this question, I decided to figure out the absolute (world space) directions of each joint in the source pose (as normalized unit vectors), and then rotate the joints of the ...
1answer
3k views

### Flip rotation matrix

I'm doing character control with kinect. I need to mirror the joint orientation because the character faces the player. Somehow by Googling through internet I've done it and everything works very well....
1answer
1k views

### Arcball Problems with UDK

I'm trying to re-create an arcball example from a Nehe, where an object can be rotated in a more realistic way while floating in the air (in my game the object is attached to the player at a distance ...
2answers
2k views

### Why do people use quaternions?

I have been using them as a black box for a while, I'm just learning about of the maths but I'd just like some definitive answers to this question. So far the only benefit I've come across personally ...
1answer
650 views

### Rotate an existing quaternion around an axis?

I have an existing quaternion (Java Quat4f). I would like to rotate this quaternion around an axis (i.e. 90 degrees around the x axis, 25 degrees around the y axis, 10 degrees around the z axis, 180 ...
2answers
3k views

### from normal to rotation matrix

(i'm on OPENGL) i have a mesh O (object) and a mesh T (terrain). i know a single triangle in T and i want to orient O to be aligned to that triangle (torate O to align to T in that point). i have ...
1answer
2k views

### how to create a Quaternion from an Orientation Vector in xna

i have a Vector3 represents an Orientation in 3D , how to convert it to the corresponding Quaternion ? is there any quick way ? EDIT : i want to add an angular velocity vector to the Orientation ...
2answers
5k views

### How do I correctly use dual quaternions for rotation and translation of an object?

Up until now I've handled a given object's rotation and translation separately using normal quaternions for rotation and vectors for translation. However I'd like to use dual quaternions to handle ...
2answers
1k views

### Why is my quaternion camera rotating around strange axes?

I can't get it to work for the life of me. Its rotating the camera in the global coordinate system, or some other random coordinate system, not the camera local coordinate system. WASDEC work ...
2answers
739 views

### How do I extract a translation vector from a dual quaternion?

I'm trying to do some things with rigid body dynamics using dual quaternions (these are not the same thing as normal quaternions!) and I'm so close to getting things to work. The problem I'm having is ...
2answers
550 views

### How can I orient a projectile along its flight path?

I have a projectile that is moving around the world (in a ballistics trajectory right now). I am currently keeping track of its position and velocity. I want to draw it oriented to its velocity, so ...
3answers
8k views

### How do I implement a quaternion based camera?

UPDATE The error here was a pretty simple one. I have missed a radian to degrees conversion. No need to read the whole thing if you have some other problem. I looked at several tutorials about this ...
2answers
8k views

### How can I rotate about an arbitrary point in 3D (instead of the origin)?

I have some models that I want to rotate using quaternions in the normal manner, except instead of rotation about the origin, I want it to be offset slightly. I know that you don't say, in 3d space, ...
3answers
804 views

### How should I model exact 90-degree rotations in 3D?

I'm familiar with quaternions... have used them in the past to model arbitrary rotations in 3D, as for a plane flying around with full pitch/yaw/roll freedom. Works great. Now I'm working on a 3D ...
2answers
3k views

### How can I rotate a sphere in response to mouse movement?

I'm using jMonkeyEngine to develop a game. I'm good at scripting, but math usually goes over my head. I tried the Wiki page for Quaternion, but I was far too confused to figure this out myself :P My ...
3answers
516 views

### Create quaternion based on where a unit is hit (shield effect as in Starcraft 2) [duplicate]

I'd like to implement a shield effect like that done for Protoss units in Starcraft 2. I'm guessing that the technique involved uses a partial sphere that is rotated to reflect where a unit is hit. ...
3answers
1k views

### Problem representing torque as a quaternion

Euler angles are much more intuitive to me than quaternions for representing 3-dimensional rotations. In fact, I barely understand quaternions at all. I use quaternions for rotation because people ...
2answers
704 views

### Quaternion understanding

I have some understanding problem concerning quaternions. In order to have my world object rotate in the correct way, I need to invert their quaternion rotation while refreshing the object world ...
1answer
4k views

### Quaternions and rotation around world axis

Disclaimer: I am a professional games programmer, and use quaternions most days but they are close to black magic to me. I am relatively at home with math but imaginary numbers always confused me. I ...
2answers
650 views

### OpenGL Camera causes spatial distortion

I'm trying to implement a 3D camera of the "Orbit around the origin" variety in a game engine I'm developing in order to learn about 3D graphics and game programming. I have a basic handle on the ...
1answer
11k views

### Orienting a model to face a target

I have two objects (target and player), both have Position (Vector3) and Rotation (Quaternion). I want the target to rotate and be facing right at the player. The target, when it shoots something ...
2answers
3k views

### GLM: Quaternion SLERP Interpolation

I wish to interpolate two quaternion values. As I still can not get working results, can I kindly ask you to verify my function calls? The code below supports GLM (OpenGL Mathemathics) library, so ...
1answer
1k views

### Moving an Object along a Curve while Rotating it

I woud like to move an object along a curve. At particular points on the curve, I wish the object to change speed and rotate itself along its axis. Imagine an airplane flying to a destination. It has ...
6answers
8k views

### Math topics for 3D graphics programming [closed]

I understand that the following math topics are required for 3D graphics programming. I have started doing some of them in my math course. Can someone point me in the direction of a resource that ...
6answers
8k views

### How can you visualize a quaternion?

When I visualise a three dimensional rotation matrix, or scaling matrix I visualize it as three axes. Is there a similar way that I can visualize a rotation quaternion?