I am converting between coordinate systems where Z is the vertical axis in one, and Y in another. I have the rotation values represented as a quaternion.  I see this related issue but it's switching the handedness (DirectX and OpenGL):   How would I go about swapping these values? I'd prefer not to convert to a vector3, modify and convert back again.
114889
I have a quaternion, coming from a system with the following:(intertial sensor)  Right handed. Forward direction: Y axis Right direction: X axis Up direction: Z axis   I need to convert this into a coordinate system that is: (Unreal engine)  left-handed. Forward direction: X axis Right direction: Y axis Up direction: Z axis   I have tried negating the axis, and angle, I have tried switching values, i cannot get this to work. All help greatly appreciated! I am working in C#, with Microsoft.Xna.Quaternion.
77619
I'm try to rig a low poly clock for blender, so I added a copy rotation constraint so the minute hand would automatically spin with the second hand, but when I rotate the second hand 180 degrees, the minute hand reverses its rotation.
88509
I have tried using glm::rotate and such. glm::translate works fine, but rotate doesn't work (if I rotate before/after a translation).  Here is my current setup:  glm::vec4 Off = glm::vec4(0, 0, 0, 1); glm::vec4 result = Util::createTransform(offset) * Off;  for (int i = 0; i &lt; Tvertex.size(); i++) {     Tvertex[i] += glm::vec3(result.x, result.y, result.z);     Tcolors[i] = currentColor; }   And here is my Util::createTransform:  glm::mat4 Util::createTransform(glm::vec3 pos) {     glm::mat4 trans = glm::mat4(1.0);     trans = glm::translate(trans, pos);     return trans; }  glm::mat4 Util::createTransform(glm::vec3 pos, glm::vec3 rot) {     glm::mat4 trans = glm::mat4(1.0);     trans = glm::rotate(trans, glm::radians(rot.x), glm::vec3(1, 0, 0));     trans = glm::rotate(trans, glm::radians(rot.y), glm::vec3(0, 1, 0));     trans = glm::rotate(trans, glm::radians(rot.z), glm::vec3(0, 0, 1));     trans = glm::translate(trans, pos);     return trans; }
73587
I am trying to translate coordinates. I have a set of coordinates for city A which I need to map to city B, given a point P1 in city A maps to P2 in city B. How do I do this? This problem would be similar to a translation transformation but in this case, it's on a sphere and not on a plane.
34087
I have a problem with flipping pose, I try to do the same thing as in . On 3:25, he flips the pose by Ctrl+C, Ctrl+Shift+V. In my case, it only flips some rotations, but legs stay in the same place:    I did everything exactly like in this video. I've tried to changing from "ZYX Euler" to "Quaternion" (saw this in some other question here) but it didn't helped.  Here is my blend file:
27884
Problem that I am facing:  So naturally I decided to shift to the polar co-ordinates, however when I try to simplify the expression remains very complicated and despite using the fact that sin and cos belong to [-1,1] I cannot get any conclusive bound.  Thanks
69417
I run into this occasionally and always forget how to do it.  One of those things that pop up ever so often.  Also, what's the formula to convert angles expressed in radians to degrees and back again?
26377
I want to acheive the same rotation you see in the inspector. In short: a smooth local Y rotation, toward a target  I have a Vector3 orientation: Vector3 dirOrientation = targetToLook.position - movingCamera.position;  So, every Update, what should I do ? I try many thing, but I don't realy understand Quaternion...  I just want to rotate localy in Y, toward a precise moving target, NOT in X or Z. and smoothly with some Lerp or Slerp.  Thanks !
116432
Every rotation in 3D space can be defined by a rotation axis and an angle. Now let's say we have two rotations $R_1 (\text{(axis)}_1, \text{(angle)}_1)$, $R_2 (\text{(axis)}_2, \text{(angle)}_2)$.  I remember that Rotation operator is closed under composition, so $R_1 (R_2(\text{object}))$ will be a rotation again.  Does anybody know how to find the new axis and angle for $R_1R_2$?
27441
I've been studying Quaternions for a week, on my own. I've learned various facts about them but I still don't understand them. My goal is to understand rotation quaternions specifically. I don't want to just memorize the formulas for using rotation quaternions, I want to truly understand them.  It's the most difficult thing I've ever tried to learn. Does anyone know any good resources for understanding quaternions?
53496
I am trying to write code with rotates an object.  I implemented it as:  Rotation about X-axis is given by the amount of change in y coordinates of a mouse and  Rotation about Y-axis is given by the amount of change in x coordinates of a mouse.  This method is simple and work fine until on the the axis coincides with Z-axis, in short a gimble lock occurs.  How can I utilize the rotation arount Z-axis to avoid gimbal lock.
10310
I am using a standard heightmapped procedural terrain in my project.  However, I want the terrain to appear spherical when the user zooms out.  This is an attempt to simulate the appearance of a spherical planet.  Here is my current algorithm:          //get the direction from the "planet" center to this vert         Vector3 sphereCentertoVertPosition = vert.Position - SphereCenter;         sphereCentertoVertPosition.Normalize();          //our rotation axis is the cross between the direction from this vert to the planet center and the root (center of the terrain) to the planet center         RotationAxis = Vector3.Cross(sphereCentertoVertPosition, sphereCenterToRootPosition);          //the amount we rotate is based on the distance of this vert from the center of the terrain         Vector3 fromCenter = vert.Position - Root.Position;         float amount = (fromCenter.Length() / ((myTextureWidth / Scale) / 2)) * (float)Math.PI;          Quaternion rot = Quaternion.CreateFromAxisAngle(RotationAxis, amount);          Vector3.Transform(ref vert.Position, ref rot, out vert.Position);   My main concern is that the rotation axis is not correct.  Theoretically, should it be the cross between the vert-to-planet-center and the terrain-center-to-planet-center?
8359
When working in a 2D coordinate system you could say that X is the horizontal axis and Y is the vertical axis.  Extending this to 3D, is there a similar word for the Z axis?  (I'm aware of Width, Height and Depth, but obviously horizontal and vertical aren't synonymous to width and height, which is why I don't want to call the Z axis the depth axis.)
122940
Why is  quaternion algebra 4D and not 3D?  Complex algebra is 2D and what is known as quaternion algebra jumps to 4D.    $ i^2 = j^2 = k^2 = ijk = -1 $  Using $1, i, j,$ and $k$ as the base (where complex uses $1$ and $i$ (or $j$ if you are an EE)) which results in a 4-axis space.  Why is there no 3D algebra?
5460
So I have these two wheels parented to the leg of a robot. I wanna make them spin a few times but they're spinning around the wrong axis. With other objects I could just press R, Y, Y to make them spin right when they're already at an angle, but for some reason it doesn't work with these. Would be amazing if someone helped me fixing this!
85022
So, I've been using Blender for several years, including a fair amount of animation, and in the past it's always been useful to align an object with its local coords. I.e. having the y-axis pointing down the nose of an airplane makes it much easier to animate.  However, I recently noticed that the keyframes aren't recorded in local coordinates (anymore?), but in global coordinates. This makes animating off-axis rotation very difficult.  Changing the rotation mode doesn't seem to help (Euler, quaternion, etc.).  Unfortunately, I can't upload any examples because the project is proprietary, and I don't really have time to setup another animation, but the example goes something like this: I want to animate a record rotating in a record player, but the player is not sitting flat, it's tilted at an angle. Normally, this wouldn't be a problem. Just model the record with z up, and you can tilt the record at whatever angle you need so that it sits on the tilted player, and still rotate the record around its own z-axis, right? Unfortunately, this is not what's happening. Instead, I animate it rotating 180d twice and it wobbles all over the place because it's interpolating global coordinates, not local coordinates.  EDIT: Here's a demo afterall:   It maybe a little hard to see because it's so fast, but the second time I animate the cube, it wobbles instead of rotating around its own z-axis like I expect it to.  Does anyone know what magic button I pressed that did this?  Or am I just crazy and remembering something that has never been possible? It's happened before...  EDIT: In fact, I KNOW this has worked before, cuz I just went back and looked at some old stuff, and I know I animated using the local coordinates then... I'm gonna go see if 2.70 behaves differently from 2.70a...  EDIT: Nope, 2.70 behaves the same way.
45269
How do I convert from object-space to world-space?  I suspect it is:  vert_os = obj.vertices[foo] vert_ws = vert_os.getPositionFromMatrix(obj.matrixWorld)   but does the matrix also handle translations, or do I need to handle that separately?  Can someone link to the relevant documentation?