quaternion

Should Quaternion based 3D Cameras accumulate Quaternions or Euler angles?

So I have written a Quaternion based 3D Camera oriented toward new programmers so it is ultra easy for them to integrate and begin using. While I was developing it, at first I would take user input as Euler angles, then generate a Quaternion based off of the input for that frame. I would then take the Camera's Quaternion and multiply it...

quaternion libraries in C/C++

Any good libraries for quaternion calculations in C/C++ ? Side note: any good tutorials/examples? I've google it and been to the first few pages but maybe you have have some demos/labs from compsci or math courses you could/would share? Thanks ...

Quaternion math for rotation?

I'm drawing a flat disk using gluDisk() in my scene. gluDisk() draws the disk facing the positive Z axis but I want it to be facing some arbitrary normal I have. Clearly I need to use glRotate() to get the disk facing properly but what should be the rotation? I remember this can be calculated using Quaternions but I can't seem to remembe...

Euler angles vs. Quaternions - problems caused by the tension between internal storage and presentation to the user?

Quaternions are arguably an appropriate choice for representing object rotations internally. They are simple and efficient to interpolate and represent a single orientation unambiguously. However, presenting quaternions in the user interface is generally inappropriate - Euler angles are generally much more familiar to users, and their v...

Is there an algorithm for converting quaternion rotations to Euler angle rotations?

Is there an existing algorithm for converting a quaternion representation of a rotation to an Euler angle representation? The rotation order for the Euler representation is known and can be any of the six permutations (i.e. xyz, xzy, yxz, yzx, zxy, zyx). I've seen algorithms for a fixed rotation order (usually the NASA heading, bank, rol...

Finding quaternion representing the rotation from one vector to another

I have two vectors u and v. Is there a way of finding a quaternion representing the rotation from u to v? ...

Spatial Rotation in Gmod Expression2.

I'm using expression2 to program behavior in Garry's mod (http://wiki.garrysmod.com/?title=Wire_Expression2) Okay so, to set the precedent. In Gmod I have a block and I am at a complete loss of how to get it to rotate around the 3 up, down and right vectors (Which are local. ie; if I pitch it 45 degrees the forward vector is 0.707, 0.70...

Wiimote orientation as a 3D vector

I wonder if it is possible, as the Wiimote has 3 accelerometers, to convert the accelerometers readings to a 3D vector. I know the trick to extract pitch/roll, but it only uses the X and Z accelerometers, and has the gimbal lock problem. What I would like is a full 3D vector, that can be converted to a quaternion rotation representatio...

Convert Quaternion rotation to rotation matrix?

Basically, given a quaterion (qx, qy, qz, qw)... How can i convert that to an OpenGL rotation matrix? I'm also interested in which matrix row is "Up", "Right", "Forward" etc... I have a camera rotation in quaternion that I need in vectors... Thanks! ...

Can I interpolate rotation from two Quaternions created from Yaw/Pitch/roll?

Quaternions are good for interpolate rotations between them. so far so good. If I have a networking game, will it suffice to transfer the rotation as vector3f or should I use a quaternion? To make the game smoother I may have to interpolate between the last sent rotation and the current one. But can I interpolate rotations between two ...

'Difference' between two quaternions

I'm working in Ogre, but it's a general quaternion problem. I have an object, to which I apply a rotation quaternion Q1 initially. Later, I want to make it as if I initially rotated the object by a different quaternion Q2. How do I calculate the quaternion which will take the object, already rotated by Q1, and align it as if all I did ...

When do I need to use quaternions?

I have been carrying out 2D and 3D operations, including graphics, for many years and have never used quaternions so I don't have a feel for them. I know that they can be used for certain operations that are difficult in Euler angles and also that they can be used to find the rotation required to best fit one set of coordinates (X1, X2.....

Quaternions and Transform Matrices

Tell me if I am wrong. I'm starting using quaternions. Using a rotation matrix 4 x 4 (as used in OpenGL), I can compute model view matrix multiplying the current model view with a rotation matrix. The rotation matrix is derived from the quaternion. The quaternion is a direction vector (even not normalized) and a rotation angle. Resulte...

How to setup Quaternion to move point to particular location?

Hello i've been working on this seemingly simple issue for more than 2 days. I would love it if you would help me out. I have some code to produce a list of vectors (19) (thisPose ArrayList) corresponding to a pose for a skeleton: private ArrayList updatePose ( int poseIndex , ArrayList listOfUpdates ) { int i; ...

Euler angles and Quaternion orientation

how to convert Quaternion orientation output of wintracker II device to Euler Angles output only. Because Wintracker II device Output Euler angles and Quaternion orientation. i want to Euler angles output only. ...

Translate Local quaternion rotation into global (gyro)

I need a way to get euler angles for rotation in global frame of reference from a local. I am using c#, wpf 3d and a gyroscope. I have a globe on the screen that should move in the same way as the gyro. Since the gyro sends movement relative to itself I need to use quaternions to keep the state of the object and update it but I'm stuck. ...

How can i get a quaternion through my 1 axis gyroscope?

My problem is, i have a 1 axis gyroscope and a 3 axis acellerometer in my device. I managed to get the quaternion through the accelerometer but i cant figure out how to do it with the gyroscope. I want to be able to, through my gyroscope ( angular rate information) get a quaternion out of it. ...

Quaternion Cameras and projectile vectors

In our software we have a camera based on mouse movement, and a quarternion at its heart. We want to fire projectiles from this position, which we can do, however we want to use the camera to aim. The projectile takes a vector which it will add to its position each game frame. How do we acquire such a vector from a given camera/quatern...

How to interpolate rotations?

I have two vectors describing rotations; a start rotation A and a target rotation B. How would I best go about interpolating A by a factor F to approach B? Using a simple lerp on the vectors fails to work when more than one dimension needs to be interpolated (i.e. produces undesirable rotations). Maybe building quaternions from the rota...

Flipping issue when interpolating Rotations using Quaternions

I use slerp to interpolate between two quaternions representing rotations. The resulting rotation is then extracted as Euler angles to be fed into a graphics lib. This kind of works, but I have the following problem; when rotating around two (one works just fine) axes in the direction of the green arrow as shown in the left frame here ...