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.
1
vote
0answers
10 views
Import Quaternions from a different coordinate system to perform an animation (DirectX to 3ds/Maya)
I'm working on a tool to import a biped from a DirectX engine that uses Left-handed coordinate system to 3ds Max that uses a right-handed one.
I managed to achieve the initial positions of the biped ...
0
votes
0answers
13 views
Transform arbitrary axes to world axes
I'm in the case I need to transform a Quaternion coordinate system to a concrete one, let me explain.
I'm implementing an orientation tracker for VR headsets, I have the orientation of the device and ...
0
votes
2answers
44 views
Unity - Stuttering character rotation
Am working on the controls and camera movement for my character. What I am trying to do is have the character head be able to rotate left and right and then when the head is rotated a certain amount, ...
22
votes
2answers
3k views
Using Quaternions: What can I do with them? (without the maths)
I am a Game Developer and did not study Mathematics. So I only want to use Quaternions as a tool. And to be able to work with 3D rotation, it's necessary to use Quaternions (Or Matrixes, but let's ...
0
votes
1answer
48 views
How is a gimbal connected with Euler rotation angles?
When I see any video that explains how gimbal lock occurs, they explain it using a gimbal machine and I totally understand the effect on that machine. What I don't understand is how Euler angles are ...
0
votes
0answers
12 views
Entity Transform Matrix Transformation (Movement and Rotation) Monogames
I started of by creating an Entity class containing a Transform property of Type Matrix which stores all the transformations such as Position, Rotation, Scale etc. I was able to move the entity and ...
0
votes
1answer
32 views
Wierd behaviour upon limiting rotation on Y-axis
Okay, this is the code that works for a FPS camera, except it allows the player to flip it over by going under/over -/+90° rotation on Y-axis:
transformation->rotateObjectFromRight(glm::radians(...
0
votes
0answers
24 views
Quaternion precision problems
Each entity and camera have a Transformation object that holds position info as vec3, rotation info as quat and scale info as vec3.
When I need a matrix (that being either model or view matrix), I ...
0
votes
0answers
19 views
how to represent rotation quaterion to another coordinate system
I am trying to combine rotation information from two system in a VR/AR scenario, one is a computer vision solution/ visual SLAM coordinate, initializing the first frame as the world origin as position[...
1
vote
1answer
66 views
Visualize quaternion euler angles without gimbal lock
I fusion ACC and GYRO data with Mahony algorithm, and then I want to show a line chart representing roll pitch and yaw to the user, so they can understand the degrees. As you can imagine, gimbal lock ...
0
votes
1answer
37 views
Roll a 6DOF camera to a plane direction
I've been working on a 6DOF camera that I want to be able to "align" to any walls orientation to make it feel like I'm standing on that wall.
I'm thinking it's a simple matter of finding the right ...
2
votes
3answers
84 views
How can I rotate the camera for a player walking around the surface of a sphere? [duplicate]
I'm making a 3D game where the player can walk across the surface of a planet.
I am having a problem correctly rotating the camera's frame of reference, so that the camera is oriented correctly ...
1
vote
1answer
37 views
Rotation smoothing with Slerp snaps to center when switching between different destination vectors
I'm making a 3D space shooter in Unity (think Star Fox). The ship, when I move it around the map, should rotate slightly (smoothly) in the direction I'm controlling it.
I have smoothness mostly ...
0
votes
1answer
41 views
Delay shooting till player has reached the correct rotation - Twin Stick
Like most Twin Stick shooters, my player both turns and shoots with the right stick. I use a Quaternion.Slerp() to smoothly rotate the player from the current rotation to the new rotation, however the ...
1
vote
1answer
74 views
Sprite rotation: is it better to rotate with a quaternion or via sprite swap?
Considering this question:
"In a generic game engine where you have an object sprite (e.g. Unity), is it better (in terms of performance) to implement a clockwise rotation calculating at each frame ...
0
votes
1answer
65 views
Switch axes and handedness of a quaternion?
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 ...
0
votes
0answers
65 views
Quaternion causes overflow in AABB
I have a game using the Bullet Physics engine. To turn the player using the mouse, I use the following code:
btQuaternion yaw(btVector3(0, 1, 0), -viewYaw);//Create a quaternion of yaw.
btTransform ...
0
votes
2answers
63 views
Why won't character stay at the x-axis rotation I set In the inspector?
Here is a snippet of my Update function, which contains everything regarding my rotations for the character:
// Higher the Z float, the LESS of a rotation when moving
Vector3 v3 = new Vector3 (Input....
1
vote
1answer
130 views
How to orbit an object around another object in an oval path in Unity?
I would like to create kind of planetary orbit structure for my game. I was used transform.RotateAround(Vector3.zero, Vector3.forward, RotationAngle * Time.deltaTime); and it rotates in a circular ...
0
votes
1answer
52 views
Using Quaternions to rotate a player towards a point
I am attempting to solve a problem involving Quaternions and 3D rotation.
I am using a games engine (Torque 3D) for a project that I am developing. I have modified the gravity system so that the ...
0
votes
2answers
82 views
Rotate character 180 degrees determine direction
In my game it should be possible to rotate the character 180 degrees. I always want the character to rotate clockwise.
If the character is rotated 0 degrees and I press the rotate button, the ...
1
vote
0answers
59 views
Limit/Clamp camera movement using quaternions
I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
1
vote
1answer
159 views
Quaternion based camera pitch freaking out, and Z-axis drift
This is the code I use to control my (first person) camera's movement and
rotation. Translation successfully keeps orientation in mind, so that up and
left and such are always in the expected ...
0
votes
1answer
205 views
Unwanted roll when rotating camera with pitch and yaw
I have a quaternion class implementation, and when I apply this class to my objects all gone right (rotations), but I have a lot of troubles with the camera. I've been searching a lot trying to solved ...
0
votes
0answers
56 views
Rotate camera with quaternions
I have a camera with a 3D vector, the position, and a quaternion, the orientation.
I'm able to move the camera in a realistic way (respect the local axis) but I can't do the same with the rotation. ...
1
vote
4answers
188 views
How can I min-max quaternions?
What I'm doing
In my engine, I'm trying to implement a camera that will follow a target object, such as a player.
I wanted to avoid just simply using the inverse of the target's transformation, ...
0
votes
1answer
154 views
Problem with Quaternions and Unity's Euler Angle Convention
So I want to rotate an UI-Element according to my magneticHeading, I just want to apply the magnetic heading to the z rotation in EulerAngles. So I tried to do so, which brought me to some weird ...
1
vote
0answers
72 views
Rotation of a point around axis using quaternions
I have a simple processing program to rotate a point around arbitrary
axis but it stops after a bit. I'm trying to get full rotation of the
point around the axis.
import org.apache.commons.math3....
1
vote
1answer
95 views
Adding quaternions is useful?
I'm working with quaternions and matrices 4x4 and 3x3, and I have a doubt.
I think that adding and multiplying quaternions is the same that converting the quaternion to a matrix, do the operation and ...
0
votes
1answer
18 views
Set up a basic D3DXQUATERNION
I'm trying to set up a D3DXQUATERNION to operate a rotation of 90 degrees around the Y axis.
I tried in the following way:
D3DXQUATERNION tempRot1(0.0f, 1.0f, 0.0f, cos(XM_PIDIV2/2));
because in ...
0
votes
2answers
57 views
Quaternion not giving correct value back. What am I doing wrong here?
Right so I made a quaternion and assigned it a value but it reports back the wrong value.
Here is the relevant code...
Quaternion LeftTurnLimit = Quaternion.identity;
float test = 0.1f;
...
0
votes
0answers
94 views
Camera movement on a sphere, and how to look while doing it
I am trying to make some kind of pointerlocked walking simulator that involves movement of the camera on the inside of a sphere. I've looked at Walking on a sphere, but that solution fights what I'm ...
3
votes
2answers
103 views
Why does transforming a Vector3 by a Quaternion result in reversed Z?
I'm trying to transform the vector (1, 0, 0) by an orientation unit quaternion, which in XNA should be:
Vector3 v = Vector3.Transform(Vector3.Right, Orientation);
But this results in the Z value ...
0
votes
1answer
115 views
Rotate smoothly object to angle (Y axis) of the collided object
Well, let's say I have two planes, one which I am moving, and another one that I collide with, that has a different y rotation. I want to make that, once both planes collide, the plane the user ...
0
votes
1answer
38 views
Limit Quaternion/vector3 axe in a certain interval
I have some trouble to understand, and handle Quaternion and Vector3. I'm improving the tutorial Tank of Unity:
EDIT: Because a video explain so much better, there is a link to the 30 secondes video ...
0
votes
0answers
44 views
How to rotate with quaternions
I need to simply rotate around an axis, but because unity uses quaternions for calculating i have issues with converting into euler angles.
When i ask for rotation of an object in euler angles it ...
0
votes
0answers
59 views
How to get correct quaternion value from real world to screen?
I'm writing an application (not a game per se, but close enough) where we use attitude sensors (an IMU) in the real world to affect the orientation of an object in the application's 3D space (OpenGL). ...
0
votes
1answer
184 views
Unity Change Ball Direction after hitting paddle in a Pong game (like in dx-ball)
I'm struggling with how to get the ball to change the bounce based on where it hits on the paddle. Normally in a pong game, the angle changes, depending on how far from center the ball bounces, and ...
0
votes
1answer
176 views
360 degree quaternion interpolation?
I am in the process of implementing interpolation into a simple game loop I am playing with after reading the infamous "fix your timestep" article (which is amazing by the way). I have the position ...
1
vote
1answer
271 views
Rotation around arbitrary vector (using quaternions?)
I currently have a camera which orbits a specific target object, always looking at it.
The user can drag the mouse to move the camera left/right/up/down and the camera will move over the surface of a ...
0
votes
1answer
91 views
Rotate object with mouse look script
I would like to rotate an FPS camera slightly upwards during a shot as an effect of recoil, but the problem is that I have a mouse look script as well and I assume it prevents me from achieving the ...
1
vote
1answer
163 views
Unexpected quaternion rotation behavior
First off let me apologize for the vague title but I really couldn't think of a more descriptive one (maybe after reading this a more advanced user might be able to edit it).
Alright, so I have been ...
0
votes
0answers
159 views
How to programmatically create an animation that linearly interpolate between two rotations?
I would like to programmatically create an animation that linearly interpolate between two angles (using the shortest path).
I wrote the following code :
Animation anim = gameObject.GetComponent<...
0
votes
2answers
148 views
Moving a ship forward from rotation
I am making a simple space simulator, where the player can control a ship using 2 controls, one for pitch and one for bank. The ship is properly rotated but I cannot figure out how to make the ship ...
1
vote
2answers
76 views
Increasing the rotation angle on a quaternion makes the rotation stop at a certain angle
I'm using the following code to change the rotation of an object:
Quaternion rot = getRotation();
setRotation(make_quaternion_axis_angle(rot.v,rotationSpeed*dt)*rot)
This code works as expected ...
2
votes
1answer
245 views
How to avoid Gimbal Lock on Rubik's Cube [duplicate]
I am making a Rubik's cube program. That will simulate a Rubik's cube. I am having problems with gimbal lock. I need to know how to avoid it. To my understanding I can either multiply the x, y, z ...
1
vote
1answer
52 views
Quaternion Types in Game Engine
I've recently been coding a quaternion class for my game engine and have run into a problem. Firstly, should I be using unit quaternions for my engine? Secondly, should I have the functions ...
1
vote
0answers
35 views
align local Y to be parallel with global Y during or after slerp
I am using the following function to have a globe rotate a point on its surface to face the global Z toward the camera. This works fine, but after each rotation the Y axis seen as a green line is not ...
2
votes
1answer
79 views
Rotating object around a rotating one?
I am developing a solar system animation in Unity3D. Planets rotates around sun. But ı have an issue simulating satellites like Moon. Moon should be rotating around world normally and moon should be ...
1
vote
1answer
194 views
Rotate camera with quaternion around axis going through the origin
I am trying to implement my own third person camera using quaternions in DirectX. I first wanted to check that the camera rotates as expected so I started to rotate it around the world y-axis (0,1,0) ...