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
1answer
31 views
Unity : how to Rotate GameObject back to Indentity position?
Hello i m trying to rotate my object smoothly over MouseButtonDown and rotate to identity position on MouseButtonUp and this code rotate my GameObject smoothly but it won't come back to identity ...
0
votes
1answer
20 views
How do I get the camera's local XYZ axis in Direct X 11?
I'm currently working on quaternion rotation and I have them working, but it seems to be using the world XYZ axis to rotate around, which is an issue as the camera rotates itself around an axis.
...
0
votes
0answers
50 views
Why does my quaternion camera rotation not rotate correctly? [DirectX11, C++]
I followed a small snippet for quaternion based camera rotation for the base of my rotations, but it doesn't seem to be working as expected and I can't really spot the issue. The outcome from this is ...
1
vote
0answers
33 views
Rotation 2d top-down view in 3d game
I have a game in top-down view, with little ants who can walk up/down, left/right and diagonal (and all direction with Joystick).
My little player can move, but I can't rotate it properly...
See what ...
0
votes
2answers
64 views
How to import camera from Blender into Unity3D
I have a few cameras in Blender to export to Unity3D. They're exported as empty GameObjects, and that's what is expected. The idea is to have the main camera be a child of one of the camera empty ...
0
votes
0answers
9 views
Fusioning check values in bounds
I am fusioning data from Acc Gyro and Magn and i have the quaternions and they are looking good and accurate in OpenGL.
What i want is that the user can define max and min rotation for each axis ...
0
votes
0answers
44 views
Transform class and gimbal lock
I am facing gimbal lock in my Rubik Cube program (opengl3.3+glm).
I am using my own Transform class which is implemented this way:
class Transform{
private:
glm::vec3 position, rotation, scale;
...
1
vote
1answer
75 views
Transform manipulator for Unity/Oculus Touch game like in Quill, Medium etc
I'm trying to create a script to manipulate the transform of a gameobject using the Oculus Touch just as in for instance Quill or Medium, with rotation, translation and scaling. Can somebody help me ...
1
vote
0answers
30 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
17 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
59 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, ...
24
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
72 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
1answer
40 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
32 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
26 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
85 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
38 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
97 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
43 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
50 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
83 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
80 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
71 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
76 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
160 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
60 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
123 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
74 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
203 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
288 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
78 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
209 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
196 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
84 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
112 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
19 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
62 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;
...
3
votes
2answers
106 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
154 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
42 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
48 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
60 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
209 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
200 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
313 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
98 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
171 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
193 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
182 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 ...