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

0
votes
2answers
69 views

2D indicator for Rotation in 3D space

This is the view from my spaceship. It can move around in 3d space and turn up, down, left and right. The planet Earth on the top right is selected. Now I want to create the red arrow to always ...
0
votes
0answers
31 views

Matching the 3ds max camera view in my game 1:1

I want to match 1:1 the 3ds max camera render with my 3d engine (DirectX 11, C++). I believe that my mesh exporter (coded with MaxScript) works fine, I see the right shapes. But something about the ...
0
votes
0answers
18 views

Quaternion Slerp Over Time Help

I've gathered some code from several places and the final result almost works correctly. However, at times there is noticeable "snapping" from one place in the rotation towards the finish or too ...
0
votes
2answers
46 views

Rotating an object with quaternion

I have a question in regards to using quaternions for the rotation of my graphics object. I have a Transform class which has the following constructor with default parameters: Transform(const ...
0
votes
0answers
55 views

How to align angular velocity wit target rotation in 3D?

I'm making a space crew sim (controlling a ship) and have recently posted a question about how to calculate ETA between two rotations. I how now a new question more well defined. Background: I have ...
0
votes
1answer
43 views

How to calculate the estimated time of arrival and control signal between two quaternion?

I'm trying to wrap my head around a control algorithm for a space game. If the user sets a target rotation I want to get a ETA counter and show the engine output. The only input to the system is a max ...
1
vote
0answers
29 views

How do I create a view matrix directly from a quaternion and a position vector?

Given a quaternionic camera such that: typedef struct { vector3 upReference; vector3 rightReference; vector3 forwardReference; vector3 position; quaternion orientation; ...
1
vote
1answer
36 views

How to compute the forward, up and right vectors from a single quaternion?

Given a quaternion float x, y, z, w; How does one the forward, up and right vector from a single quaternion? vec3 up; vec3 forward; vec3 right; quat_get_all_axis(&quat, &up, &forward, ...
0
votes
1answer
59 views

How can I add banking and rotation to this object manipulation script?

I have made a drone script that allows user to move in four directions and ascend/descend. I found a nice tilt snippet which makes the thing bank when it moves. However, when I include this, the ...
0
votes
2answers
65 views

How to get quaternion from two orthogonal 3D vectors?

I have a unit vector representing the direction I want to "look" and a unit vector for up. They are orthogonal. How can I get the quaternion that represents that orientation from those two vectors?
0
votes
1answer
96 views

Camera Movement Smoothing

I am trying to smooth a camera I create in my game, but I can't seem to find a way to actually do this correctly. What I have : //Calculate the "current" Forward vector var cameraForward = ...
0
votes
0answers
42 views

Trackball Rotation using Quaternions

I am trying to figure out rotations using quaternions. I am using a trackball that tracks the mouse when I click. So when I click on the right and drag to the left, the cube rotates around the y ...
1
vote
1answer
169 views

Trouble With Quaternions and orbital camera:

UPDATED: I have been trying to implement a Orbital Camera of sorts in a engine I am currently doing in Unity3D, the issue being I can't seem to do the correct rotation no matter what. This is what it ...
1
vote
1answer
83 views

How can I support the clamping of quaternion-based rotations?

Currently I have an orbiting camera that fixates on a single point. In the node-based structure, _cameraNode is a child of _cameraTargetNode. I am able to orbit around the target node via the ...
1
vote
2answers
106 views

DirectX Quaternion SLERP Wrong Answer?

I have some code that looks like this: DirectX::XMVECTOR a, b, c; a = DirectX::XMQuaternionIdentity(); b = DirectX::XMQuaternionRotationAxis(DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f), 3.1415f); c ...
1
vote
2answers
216 views

Quaternion Rotation - Clockwise or Counter-Clockwise?

when we specify a Quaternion as (axis of rotation, rotation amount), in which 'direction' is the rotation, assuming we are looking down the rotation axis (i.e. camera at the origin, looking along the ...
0
votes
1answer
52 views

How to increase the rotation of a quaternion by a percentage of X % in a Unity script?

There is a simple way to increase the rotation described by a quaternion by a percentage X? Sorry, but in the documentation of Unity3D I found nothing and I have a poor knowledge on the topic.
1
vote
1answer
119 views

Get quaternion between two objects on sphere

In a planetary gravity environment objects are represented in the following way: struct object { struct quaternion quat; // quaternion to represent the rotation between the object and the center ...
0
votes
0answers
46 views

Euler angle and quaternion rotation [duplicate]

If I have a player at [12,0,54] and an enemy at [5,0,-9], to calculate the Euler angle for the enemy to rotate and face the player, would I subtract enemy minus player positions and then divide that ...
0
votes
0answers
70 views

XNA C# - Get original rotation from parent bone transform

I have a 3DS Max made model, exported into FBX and imported into XNA project. The parts I am working with have NOT been rotated in Max (specifically, collision mesh is made of Axiz-Aligned boxes). ...
0
votes
0answers
221 views

Camera Rolling when Implementing Pitch and Yaw

I am implementing a camera in opengl for an android game and am having problems getting the pitch/yaw/roll of the camera correct. I have read many tutorials on quaternions and have implemented a basic ...
0
votes
0answers
54 views

3d Rotation problem

I was given an interesting (but tough) problem to solve: In a game, you want to change the heading of an enemy by +30°. Construct a Rotation Matrix, Euler Angles and a Quaternion that would do this. ...
0
votes
2answers
155 views

Explaining vector math for a pendulum camera

I came across a code that I guess is doing a pendulum camera, that's the class name. I would like to know the math behind that. I would like also to know how to decipher those stuff in game math, ...
0
votes
2answers
117 views

Strange quaternion rotation

I was implementing some quaternion rotations in too my infant 3d game engine and the rotations were really strange? Excuses my cluelessness. Anyways this is what I have: static XMVECTOR ...
0
votes
2answers
135 views

Quaternion Rotation Help

So I'm making a little engine with DirectX 11 and C++. (Some other help from other API's as well) DirectX has this function XMMatrixRotationQuaternion(XMVECTOR quaternion). I know nothing about this ...
3
votes
1answer
449 views

glm direction vector rotation

I'm working on a flight simulator, but I'm stuck with my airplane orientation. I tried some things but noone worked correctly. This is what I have : To be able to move it and roll it around himself, ...
0
votes
2answers
193 views

Quaternion rotation, translation, scale or 4x3/4x4 matrices for Skeletons?

I'm modding a game that uses 4x3 and 4x4 matrices to make skeletons, but I saw that an skeleton can also be made with a quaternian rotation and vector translation and scaling. What's the difference ...
0
votes
0answers
127 views

JBullet quaternion to Euler angle conversion causes strange flipping behavior

I am making a game using JBullet (a Java port of C++'s Bullet library) for the physics and LWJGL for the graphics. However, JBullet measures angles in quaternions and LWJGL uses Euler or ...
2
votes
2answers
131 views

What are “local” and “global” rotations?

Each node in jME3 has local and global rotations, which can be expressed in quaternions. What are they? Documentation has no clues, about in which state rotations are zero?
1
vote
1answer
273 views

How do I create a camera?

I am trying to create a generic camera class for a game engine, which works for different types of cameras (Orbital, GDoF, FPS), but I have no idea how to go about it. I have read about quaternions ...
0
votes
1answer
527 views

Repelling a rigidbody in the direction an object is rotating

Working in Unity, I have a game object which I rotate each frame, like so: void Update() { transform.Rotate(new Vector3(0, 1, 0) * speed * Time.deltaTime); } However, I'm running into problems ...
0
votes
2answers
128 views

Convert vector interpolation to quaternion interpolation? (Catmull-Rom)

I have some existing code which does catmull-rom interpolation on two vectors (facing and up). I'm converting this to use quaternions instead (to replace the two vectors). Is there a general way to ...
2
votes
1answer
35 views

Can I use quaternions and do a partial multiplication?

I have some code that rotates an object around an axis. It does this by creating a quaternion for a rotation and then multiplying by the old orientation: nextRot = QuaternionRotationAxis( axis, ...
4
votes
2answers
230 views

Unity - Quaternion - Rotate / Unrotate Error

I'm trying to un-rotate a quaternion, aligning it with the axis, and then rotate it back to where it was originally. But with every iteration it seems to lose precision and just after 20 iterations ...
2
votes
0answers
170 views

Quaternion - rotating rigidBody to particular angle over time

Using Bullet Physics. There's a rigid body that is rotated. For some delta-time I need to rotate that body to have rotation of (0, y, 0) - keep the old y value rotation but reset x and z. The ...
0
votes
0answers
99 views

rotating sprite with quaternion in scenegraph

I have been trying to set up a scenegraph in XNA, which I then use to draw sprites in the correct places. It uses matrix transformations to accomplish this. So far, I got position and scale working ...
1
vote
1answer
211 views

Custom lookAt function goes wild

I have written a custom lookAt function based on a lot of posts from all over the net, and it works very nice... except when a rotation (which is stored in a quaternion) crosses some 'threshold'. ...
0
votes
0answers
125 views

GLM Rotating Combining Multiple Quaternions?

I have a camera which I want to control with my mouse. I want the mouse to control the pitch and yaw of the camera but not the roll. To avoid loss of significance, I am storing the quaternions for ...
1
vote
1answer
356 views

How can I restrict the rotation of an object to a subset of axes using quaternions?

I've got a question about quaternions in my WebGL application. How can I rotate an object only around two axes? For example, how can I exclude/nullify rotation about the Y axis? The problem is that ...
0
votes
1answer
157 views

Strange quaternion camera streching in WebGL

So after a lot of researching about quaternions I almost got the quaternion camera working. Almost, cause it rotates in a proper way only in a vertical axis. Other rotations stretches and deforms the ...
0
votes
1answer
385 views

How do I make an object's y-axis align with a Vector3?

I have a golf ball on the ground, and from a raycast, I have the normal which gives me the slope of the ground by the ball. I have an object which is rendered on the HUD to show that slope to the ...
0
votes
0answers
55 views

How to move objects flat on different planes in 3d?

I need to move objects in circular/square/sinusoidal patterns in a flat manner on a collection of different and rotating planes in 3d space. I have the perpendicular of the planes. One method is to ...
17
votes
0answers
721 views

How can I compute a Jacobian matrix with dual quaternions? [closed]

I'm trying to understand an inverse kinematics algorithm realized with dual quaternions as presented here. My Jacobian matrix, however, seems to be calculated wrong. Could somebody explain, ...
0
votes
1answer
793 views

How to get plane rotation by known normal vector

I have a FPP quaternion Camera and Plane with known normal vector. I want to find the orientation of this Plane so I can replace it to the Camera orientation to put the camera forward vector to a ...
3
votes
1answer
266 views

Inertia Tensor and World Coordinate conversion

I understand that the inertia tensor is basically a 3x3 matrix. I'm modelling a cube, and the inertia tensor for this shape has values for moment of inertia on the main diagonal of the matrix. All the ...
0
votes
6answers
2k views

Quaternion Lerp never reaches target

I seem to have misunderstood something about how LERP works. Im not sure what is missing. The object is rotating as it should, but it cant seem to get it to end. The transform.rotation dont seem to ...
1
vote
2answers
464 views

How can obtain the relative orientation between two quaternions?

How do I obtain the relative orientation given two orientations (represented by quaternions q0 and q1)?
0
votes
2answers
440 views

Rotate GameObject on click

I'm trying to get a card to flip when clicked but the flipping only works the first flip. While debugging, I can see that OnMouse is called every time I click. public class CardController : ...
4
votes
4answers
377 views

Why not use vectors to represent orientation?

From what I've read, people mostly use either quaternions or 3x3 matrices to represent 3D orientations, while plain vectors are used for angular velocity/momentum. Since we can use vectors to ...
0
votes
1answer
249 views

up vector for quaternion

First, I know there's a question exactly like mine, and some ohter really close, but my implementation of the solutions didn't work at all. Ok, now to the question. I created some forms of camera ...