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.

learn more… | top users | synonyms

17
votes
1answer
7k 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 ...
9
votes
2answers
4k 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, ...
11
votes
2answers
2k views

Arbitrary Rotation about a Sphere

I'm coding a mechanic which allows a user to move around the surface of a sphere. The position on the sphere is currently stored as theta and phi, where theta is the angle between the z-axis and the ...
7
votes
3answers
2k views

How to keep my Quaternion-using FPS camera from tilting and messing up?

I am using an FPS-like camera, and it uses quaternions. But, whenever I try looking up and then sideways, it tilts, and sometimes it can turn upside down. How can I fix this?
4
votes
1answer
650 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 ...
1
vote
3answers
327 views

Inverting matrix then decomposing gives different quaternion than decomposing then inverting the quat

I'm getting different signs when I convert a matrix to quaternion and invert that, versus when I invert a matrix and then get the quaternion from it: Quaternion a = Quaternion.Invert(getRotation(m)); ...
11
votes
2answers
1k 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 ...
12
votes
6answers
5k views

Math topics for 3D graphics programming

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 ...
5
votes
1answer
224 views

Walking on a sphere

I'm working on a game which involves walking your character on the surface of a sphere. Using the answer to Arbitrary Rotation about a Sphere, I've written my code as: if (game.isKeyDown(37)) { // ...
3
votes
1answer
865 views

Quaternion Look At with Up vector

I have implemented a "look at" method for my screen elements and it almost works how I want it to work. The ScreenElement class uses a R3 Vector and a Quaternion to determine the position and ...
1
vote
0answers
128 views

How to set object's / node's absolute rotation correctly?

Usually when I want to rotate an object/node in my Ogre scene I call the node's rotate() method. That rotates the node locally relative to it's current rotation. So for example, when I start with 0 ...
0
votes
1answer
377 views

Rotation matrices from Quaternion.Identity and -Quaternion.Identity are the same?

If I create a rotation matrix from an identity quaternion then it is the same as a creating it from a negative identity quaternion Matrix m0 = ...