Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [quaternion]

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.

0
votes
2answers
51 views

Quaternion angle calculation

I'm working on a programming project, in this project I'm receiving an angle as a quaternion value, I partially understand how they work but I don't find any math to get the values I need. What I ...
1
vote
1answer
58 views

What are the semantics of these quaternion functions in XNA/Monogame?

I am having trouble understanding the semantics of some members of the XNA/Monogame Quaternion class. The docs are not helpful, and tutorials trying to explain ...
0
votes
2answers
94 views

Moving an object at an angle based on quaternion rotation matrix (c++)

I have been trying to figure this out for a while now, and can't seem to get a working method. I am building a space ship movement with the following movement keys: P = accelerate (move forward) A = ...
0
votes
1answer
27 views

How to align 2 IMUs' quaternions?

Suppose I have 2 IMUs that output 2 quaternions. I place one IMU on my left hand and another one on my right hand. I put both my hands flat on the table and point it forward to the same direction. ...
0
votes
1answer
42 views

Quaternion representing rotation from shoulder to hand

I am provided with 3 quaternions. One for the shoulder, one for the elbow, and one for the hand. What I want is to obtain a single quaternion representing the rotation from the shoulder to the hand, ...
0
votes
0answers
46 views

How to rotate bones in Unreal using ONLY C++?

I have a reference to a SkeletalMesh. As a test I'm able to move the mesh with the AddLocalTranslation, so I know I have the reference to the correct object. So I created a bone map with bone names as ...
0
votes
3answers
107 views

Creating orientation Quaternion from forward vector

Suppose that I have an orientation Quaternion Q, I can compute its forward vector from V = Q * Vector3.forward easily. ...
0
votes
1answer
54 views

Do all normalized quaternions represent valid rotations?

Basically, I'm getting a bug where the rotations in the animations seem to be skewing the model even though I'm normalizing them. I suspect that the rotations are showing the error, but not causing it,...
0
votes
1answer
41 views

Can you decompose a rotation into a rotation around an axis and a quaternion?

I have a rotation represented by a quaternion and I want to get a rotation angle around the forward axis together with another quaternion which will together represent the original rotation. The ...
-1
votes
1answer
48 views

How to calculate inverse of quaternion?

I would like to calculate Quaternion.Inverse(Vector3(45,85,96)); but I got error message ...
2
votes
1answer
131 views

Reconstruct Quaternion from 48 bit rotation data

I'm trying to reverse an animation file from a commercial multiplayer game, whose format was recently updated. The problem lies within joint rotation information, which changed from a 128bit format to ...
0
votes
1answer
61 views

How can I use a redundant axis of rotation to prevent gimbal-lock & calculate a position for that axis?

I have a theodolite-like device that is trying to track a point such that it's "Forward" is always facing that point. Here is a GIF of it working as of now. As expected, when the value of the Red ...
0
votes
1answer
33 views

Calculate quaternion rotations between two values

I have a quaternion Q1: X: -0.023995593190193176 Y: -0.4076451063156128 Z: 0.04357096180319786 W: 0.9117847681045532 and I have a keyframe value Q2 which is based on Q1: X: 0.176469 Y: -0.368251 Z:...
2
votes
1answer
86 views

Why do I need to offset my aim rotation angle by 90 degrees?

I have this simple code to rotate an object (gun barrel) towards a target object (rocket ship). The gun barrel rotates towards the ship but is always 90 degrees off. I have fixed this in my code as ...
0
votes
0answers
77 views

Problem about simulating rigid body rotation with bullet physics engine

I want to simulate an object imposed by a torque T={1,1,1} with reference to the world frame. The mass of the object is 1Kg, and its diagonal elements of inertia tensor is {2, 1, 1}. However bullet2.7 ...
1
vote
0answers
161 views

ANSI C (C11) math libraries? [closed]

I know there are a multitude of C++ math libraries out there, but my current project is C-only (C11). So far I've made due with writing my own matrix/vector functions, but now I need to do the more ...
0
votes
0answers
320 views

Make Camera smoothly orbit around my object with mouse/touch input but with limit on z-axis

I am making kind of a showroom where when I drag with mouse/touch, I want my camera to smoothly rotate (kind of orbit) around my main game object. What I have done so far is, that I have my camera ...
0
votes
0answers
21 views

How to handle rotation of props being spawned along spline mesh in Unity

I have a spline editor that creates a mesh along it with a given width, kinda like a road. I am trying to repeatedly spawn a model along the mesh. The position is correct, but the rotation is off. The ...
0
votes
2answers
69 views

How to rotate object just like in the scene?

Look at this image, I selected an object and pivot is set to local: When I rotated selected object in the scene by X axis, it rotates exactly I wanted. But if I rotate axis from inspector or script, ...
2
votes
1answer
261 views

Unity: Particle System start rotation completely incorrect when set via C# script

I am trying to set the starting rotation of a particle system via c# script so that the particles orientate with another object in the scene. My particle system 3d rotation is set as follows: ...
0
votes
0answers
64 views

assimp incorrect / wrong bone offset matrix

https://youtu.be/yyKQ-W2zxi4 This is youtube url showing what problem I have faced. I am currently using Assimp and DirectX 9.0 sdk for implementing skinned mesh animation I understand the pre ...
1
vote
1answer
864 views

Converting a quaternion in a right to left handed coordinate system

I have a quaternion from an IMU that id like to represent in unity. The issue is that the sensor uses a right handed coordinate system while unity uses a left handed coordinate system. In order to ...
0
votes
0answers
20 views

Unexpected Camera Rotation in Unity

I've been writing a custom third person controller and I almost have the camera working the way I want for basic movement. The problem I am having is that whenever I rotate the camera with the right ...
0
votes
1answer
42 views

Object is not rotating from right direction

im beginner to unity so im using this code to rotate object with mouse with max rotation of 35 degrees,it is working but it's only possible to rotate object if mouse is under of that object. here is ...
1
vote
1answer
62 views

How to smooth rotations?

I have a semi-regularly (15fps to 60fps) sampled source of position and orientation to which I am using dead reckoning to fill in gaps. However, I would like to smooth it further to eliminate any ...
0
votes
0answers
47 views

Rotating a camera around an object with PhysX

I'm working on a PhysX project with GLUT and I'm attempting to have a camera rotate around an object, steered by the mouse. My first step was to port over the C# code found here: http://wiki.unity3d....
2
votes
1answer
106 views

Pitch becomes yaw as camera gets near object

I have been having trouble with my camera, first encountering the roll tilt that is so many times asked... I fixed that issue by following the instructions at this link: Unwanted roll when rotating ...
0
votes
0answers
20 views

Are there “default” vectors when dealing with bones represented by quaternion orientation

From what I understand about bones that use quaternion orientation, the delta between the initial quaternion (such as one in a MD5-mesh file) and the correlating animation frame quaternion is what's ...
0
votes
1answer
50 views

How do I represent a MD5-mesh bone (quaternion orientation)

Going off this link about the MD5Mesh file format, I see a bone is represented as: ...
0
votes
0answers
52 views

Calculate smooth transition between local space angles

I'm trying to calculate direction of moving character (to rotate it's animation). I have something like this: Character can have 4 cardinal directions. The rotation is calculated from the current ...
1
vote
0answers
21 views

Quat.AngleAxis broken on one axis

I have a scene in my game where you create your own designs by placing static meshes and manipulating their scales, positions, and rotations. For the rotations I'm using Quaterion.AngleAxis as so: <...
0
votes
1answer
82 views

Avoid rolling whith quaternion

I'm using a Look At function (idem as nasskov answer on this post) to orient a model: osg::Quat result = quatLookAt(normalize(velocity)); It works but may let ...
0
votes
1answer
410 views

How can I set only the players X rotation to 0 in Quaternion.Slerp in Unity?

I want to set the players X axis to zero while he is turning to the target Object but I dont get it to work. Code: public float rotationSpeed; ...
0
votes
0answers
131 views

Cannot Rotate on each axis independently with Quaternions

I'm having trouble with my 3rd person camera in Unity game engine. I have a transform that I want my camera to follow its rotation, so I'm changing the rotation of the camera ...
0
votes
0answers
65 views

Rendering a hand in fixed pose using Unity3D Leap Motion

In essence, I am trying to put the hand into a fixed pose (a fist for example) but have it still move and rotate with the live hand data. I have created a custom class which I use to store the hand ...
3
votes
1answer
440 views

Why is my model rotating opposite direction around the Y axis?

I have a simple scenario. I have a simple scene, and in it I'm drawing a grid and a model, with some axis for orientation. I noticed when I rotate the model about it's local Y axis, if I rotate the ...
0
votes
1answer
156 views

Unity wheel collider extra camber angle

I want to give the value of a camber to the wheel collider my game. When the car stops, there is no problem visually, but as the wheel rotates, the wheel makes odd rotational movements together with ...
1
vote
0answers
37 views

How to apply constraints to limb movements of a 3D human model?

I'm animating a 3D human model using playcanvas game engine according to the quaternion data provided by IMU sensors. How can I limit the movements of the limbs of the human model to avoid unrealistic ...
1
vote
3answers
575 views

How to make a 90 degree rotation happen over time

I'm trying to take a RotateAround function and make it happen over time. I've been tinkering with Quaternions to try and get it to work but I can't quite figure it out. This is the code: ...
0
votes
1answer
164 views

Calibration using quaternion

I have an external hardware which gives me quaternion values. Now I would like to calibrate the device at a certain position and show tilt variations from that position on the UI. For example, I have ...
0
votes
1answer
53 views

Restore object right vector to horizontal position using quaternions

I'm fairly new in gamedev mathematics and i have a problem i cannot solve on my own. I'm working on L-System tree generation engine and i'm having serious difficulities while trying to work out ...
0
votes
1answer
170 views

Rotation of a cylinder between to spheres in R3

I want to connect two spheres with the coordinates [ax, ay, az] and [bx, by, bz] with an cylinder which is placed in between the spheres an rotated. For the placement I calculate the center of the two ...
0
votes
1answer
116 views

Create rotation in random direction from existing rotation

I am working on a game in Unity, and I currently have a game object (object A) located at the origin. I have a child of this game object (object B), that is 10 units back on the z-axis. When I rotate ...
1
vote
0answers
140 views

Convert a quaternion from one coordinate system to another, which are not orthogonal to each other

I found a similar question like this in the following link: https://stackoverflow.com/questions/18818102/convert-quaternion-representing-rotation-from-one-coordinate-system-to-another/18818267 In ...
1
vote
2answers
60 views

Rotating a gameworld using quaternion

I'm a hobbyist programmer at best and I had an idea I wanted to test in Unity, I wanted to rotate the game world around 90 degrees, to this end I've been learning a tiny bit about quaternions, in this ...
1
vote
1answer
1k views

Rotating according to ground normal on Unity 3D

I know there are already some threads about this, but my problem isn't exactly with the algorithm itself. I was able to use RayCast and get the ground normal, using it to store the rotation necessary ...
2
votes
1answer
56 views

Quaternion Orientation / Sensor

I am posting here even though this isn't technically a game development question, but involves quaternions. I have a 9-axis sensor which gives me a world-frame (gravity, magnetic-north) quaternion ...
0
votes
2answers
353 views

Rotating plane to face object while rotating around z axis. C++

I want to create a plane 2d sprite plane that looks at a 3d object and then rotates by its z axis. So I have created a LookAt Function in my game which will make the object look automatically at the ...
1
vote
1answer
167 views

Quaternion Rotation Weird Rotation

I have an fps camera, and i am representing rotation with quaternions. every frame i grab how much the mouse moved that frame and then i simply do ...
1
vote
0answers
45 views

Unwanted continuous rotation with Quaternion

I am probably missing something simple but ... this is how I'm calculating the world matrix of my object: ...