1,512 questions
-4
votes
0
answers
76
views
3D graphics problem with quaternions multiplication [closed]
if someone can understand the problem, please help. There is an unexpected behaviour when multiplying quaternions.
I have a model part with initial offset. The model part has initially been rotated - ...
1
vote
1
answer
68
views
Different formulas for quaternion computation from Matrixes using scipy
I have [q1, q2, q3, q_c] a quaternion (scalar last) that reprensents the rotation from an origin to a body frame.
I use scipy.spatial.transform.Rotation to get rotation = Rotation.from_quat([q1, q2, ...
0
votes
1
answer
172
views
Intermediate between two quaternions
In the below code snippets, vec4 is simply an alias for std::array<float, 4> where index 0 is x, 1 is y, 2 is z, and 3 is w.
I want to find an intermediate q3 such that q3 = q1 + (q2 - q1)*ratio ...
1
vote
0
answers
70
views
Euler angles continuity ZYX (Yaw Pitch Roll) when pitch crosses ±90
I’m using a Force Dimension Omega.7. From its 3×3 rotation matrix
𝑅
, I extract ZYX Euler angles (Yaw–Pitch–Roll) as:
double yaw= std::atan2(R\[1\]\[0\], R\[0\]\[0\]); // Z
double pitch = std::...
6
votes
1
answer
301
views
System.Text.Json is not handling Quaternions - is there some Json settings we need to set/support?
We are having some issues deserialising classes with Quaternion properties.
We are seeing very odd behaviour.
The Quaternions deserialise correctly (we can do a custom JsonConverter to confirm the ...
0
votes
2
answers
256
views
How to rotate one vector around another by a certain angle using struct and quaternion in C language?
I am solving this problem-
U and K are vectors is R3. U rotated around K by an angle θ in radian produces a new vector V. Find the components of V as functions of U , K and θ.
I solved the problem ...
0
votes
0
answers
54
views
Mapping Phone Quaternion Data to Vulkan Coordinates and having Consistent Rotation Behavior
I'm working on a Vulkan project that takes my phone Quaternion data through a UDP connection, and then is used to transform the coordinates of a sword. However, the model doesn't accurately represent ...
0
votes
1
answer
70
views
Raycast only collides with terrain, it gives a position directly infront of my ingame vehicle if I look at anything that's not terrain. (unity)
My original problem was that the raycast system I was using to get my turret to aim at where my camera was pointing failed to function when aiming at enemies or the sky, it would aim at the ground ...
0
votes
1
answer
116
views
DirectX. Quaternion to left-handed 3x3 matrix
I am using X-files to store 3D models. I want to take rotation from X-file. In X-file rotation is represented by quaternion. I am using DirectX 11 and left-handed coordinate system. I want to create ...
0
votes
1
answer
98
views
Quaternion Rotation mirrors or flips sometimes C#
I did implement my own class in c# of quaternions to understand how 3D objects are displayed on computer screens. That worked really well, but if i try to rotate all the points of an object above 90 ...
0
votes
0
answers
53
views
Smartphone attitude rotation from reference frame, airplane like
I am working on a mobile application using magnetometer, gyroscope and accelerometer to get information about device attitude as yaw, pitch and roll.
I am using Expo which has a DeviceMotion API ...
0
votes
0
answers
31
views
Print rotation angles when rotating with TransformControls in R3F
I’m trying out R3F in React and rotating a capsule model using TransformControls (only on the Z-axis). I want to print the current rotation angle whenever it changes, but only the initial angle gets ...
0
votes
1
answer
143
views
DirectX quaternion camera - rolling when changing pitch and yaw
Ok so, I'm currently making my own little engine using DirectX11. I got a lot of things working and decided to go back to my Transform class to make it a bit more polished. I changed my rotation from ...
1
vote
1
answer
86
views
Disagreement between SciPy quaternion and Wolfram
I'm calculating rotation quaternions from Euler angles in Python using SciPy and trying to validate against an external source (Wolfram Alpha).
This Scipy code gives me one answer:
from scipy.spatial....
1
vote
1
answer
404
views
Convert glm::quat to glm::vec3 of Euler angles? [duplicate]
How to convert glm::quat data to glm::vec3 angles?
Example:
I've start data:
glm::vec3 start = glm::vec3(90, 30, 45);
and after convert to quat
(0,730946)(0,016590)(0,677650)
.... How to convert ...
0
votes
0
answers
58
views
Why are OMPL quaternions almost 0?
I'm working with OMPL trying a version of this demo but changing it to 3 dimensions and using it for ROS2 (That last part about ROS2 is not relevant). Of course, I need the quaternion to make the ...
1
vote
1
answer
107
views
Using Quaternions in Jacobian IK
I'm working on an Inverse Kinematic system using Jacobian, but I am struggling with creating a Jacobian matirx populated by partial derivatives for/with quaternions. At the moment I am using Euler ...
1
vote
0
answers
44
views
glm::quat-based camera behaving wierdly
I am writing a camera controller for my project and I have rewritten it many time, but for some reason every time I look up or down about 50° the camera starts rotating rapidly.
Here is my current ...
0
votes
1
answer
267
views
ECI/body frame quaternion confusion
I have just started trying to wrap my head around the basics of using quaternions in my rocket simulation to handle guidance maneuvers. In my sim, I keep an ECI-to-body quaternion transform updated at ...
0
votes
0
answers
55
views
Transformation conventions and ROS Issue
I have given following transformation:
arguments=['-0.005', '0.1370', '0.00548', '0.0148379', '-0.1494206', '0.9886599', '-0.0021957', 'wrist_3_link', 'camera_color_optical_frame']
This is being ...
-3
votes
2
answers
228
views
Rotation of a cube in a 3d space in unity
i like to rotate a cube on the vertical as well as the horizontal axis.
For this I have 4 inputs. Rotate left/right and up/down. The input ranges from -180 to 180 degrees on each axis.
I have tried ...
0
votes
0
answers
37
views
Issue with Magnetometer-Based Quaternion Heading Using Madgwick Algorithm
Currently, I am calculating quaternions using the Madgwick algorithm, incorporating magnetometer values. I have tried the code provided in Madgwick's original paper and also the implementation by Kris ...
0
votes
0
answers
61
views
C# SharpDX, Quaternion Squad not continue
I'm using SharpDX to perform Squad interpolation of quaternions, but the calculated results are not continuous. Here is the code. What is the issue, and how can I fix it?
The following graph ...
0
votes
1
answer
162
views
Is there a way to avoid quaternion precision error?
I am trying to use quaternions to deal with 3D rotation.
I noticed that sometime I have small errors here and there. I am using Eigen as math library.
Here the shortest code that shows the issue:
...
1
vote
0
answers
44
views
Setting joint hierarchy rotations to a new bind pose with quaterions
Edit: Adding a more concrete example and some images.
Normally you can take the HIERARCHY section of a BVH file, plot the joints with their positions relative their parents and display the bind pose (...
0
votes
1
answer
48
views
Project 3D vector onto 2D plane
Consider two vectors (or quaternions) in 3D space.
Consider a plane normal to one of the vectors.
How do I calculate projection of the second vector onto the plane?
By projection I mean 2D vector on ...
0
votes
1
answer
54
views
Rotate a 3D Vector around Axis and degrees
I try to rotate a Vector (0,0,-1) around an axis (Y) (0,1,0) with specific degrees (90°) using the System.Numerics Libary from .NET
My Problem is that i get a wrong output and i dont get the Problem.
...
2
votes
0
answers
299
views
Invalid assignment error in Godot when trying to assign a Quaternion?
In Godot, I'm getting the error "Invalid assignment of key or property 'basis' with a value of type 'Quaternion' on a base object of type 'Transform3D'." from the following function:
...
-1
votes
1
answer
40
views
Why isn't my code which is supposed to target and turn towards player not working? I filled in all variables btw
my problem is that it knows to turn because I added a debug.log statement but it still will not turn even though I have the quaternion.RotateTowards function.
At first I tried to replace the ...
0
votes
1
answer
182
views
How can I convert euler angles to a quaternion and extract them?
When trying to extra Euler angles from a quaternion I appear to be flipping the y and z components, but I don't understand how or why. I am within a left handed coordinate system and it appears that ...
2
votes
2
answers
154
views
In Unity, why does a roll of 360 degree represented in Quaternion have a different value?
Quaternion in Unity has been quite reliable despite some quirks in terminology (e.g. being in a reference frame that is both left-handed and right-handed), and for many months I've taken it for ...
4
votes
1
answer
827
views
How do I convert a Quaternion to Euler using glm and C++?
In my project, I use quaternions in my code, but I also want to be able to use Euler angles in other parts in my code because it's easier for me to use. But when I rotate the Y axis of a glm::...
0
votes
1
answer
257
views
Why does the conversion from rotation matrix to quaternion and vice-versa does not work for some matrices?
I am struggling with the conversion between some rotation matrices and vice-versa in Python and I can't seem to get what's wrong with those not working.
There are some other posts, detailing that ...
0
votes
2
answers
97
views
Is Quaternion (-Q0, Qx, Qy, Qz) the same as (Q0,-Qx, -Qy, -Qz)?
Could you tell me if Quaternion (-Q0, Qx, Qy, Qz) is exactly the same as (Q0,-Qx, -Qy, -Qz)?
I am testing a SW tool against a formula and I have noticed that sometimes the signs are different.
The ...
0
votes
0
answers
48
views
Find difference in Rotation about a specific sequence of rotation
I have two Quaternion rotations
Quaternion rotation1 = Quaternion.LookRotation(forwardVector1, upVector1);
Quaternion rotation2 = Quaternion.LookRotation(forwardVector2, upVector2);
I want to ...
0
votes
0
answers
66
views
Calculating heading of vehicle with IMU in random starting orientation
I can’t get my head around this problem.
I’m doing this in C but I need help with quaternions.
I have an IMU (3axis gyro & accel) in a box. This box can be positioned in any orientation, then ...
1
vote
2
answers
509
views
Is it possible for a quaternion to represent a rotation pass 180 degree?
I am wondering if quaternions can be used to represent a rotation that is beyond 180 but below 360 degrees?
I am asking this in the context of Unreal Engine's FQuat library where my combined ...
0
votes
0
answers
46
views
Compensating IMU orientation
I have an IMU sensor giving me a normalized quaternion for its orientation. However this quaternion does not match the coordinate system that I want to use. For example, the roll and the yaw axis are ...
0
votes
0
answers
82
views
Quaternion-based State Estimation giving wrong values when pitch approaches 90 degrees (STM32 project in C)
I had a problem concerning state estimation with quaternions, specifically with the practical application with an actual IMU. In my simulation in Matlab, my state estimation model worked fine (I used ...
0
votes
1
answer
144
views
In Unity engine, why are Quaternion & Euler angles uses different Chirality?
I experimented with a simple Unity program with 1 camera, with a tracked pose driver. The result looks like this:
When given a Euler angle of XYZ format:
pitch up <=> X decrease
pitch down <=...
0
votes
1
answer
51
views
Find semi-equivalent Euler rotation vectors with one axis zeroed out
I’ve been stumped by a 3d math problem that exploits my weakness in quaternions! I am visualizing data from a physical sensor in unity / c#.
I have a ‘rod’ object with a rotation represented by the ...
0
votes
1
answer
280
views
How to convert a 3D point from Global coordinates to Local coordinates?
I have a point A = (Tx=-27.95, Ty=-94.68, Tz=-49.53, Q0=0.3222, Qx=-0.0062, Qy=-0.0092, Qz=0.9466).
Point A is a Global coordinate.
Now, Point A is my reference local coordinate axes
I have a second ...
2
votes
1
answer
228
views
How do you represent quaternion rotations in 2 dimensions?
I'm developing in Android Studio Java with two Bluetooth IMUs that give quaternions. The sensors are oriented in the following way to start:
In the image shown, this is considered the “zero” position....
0
votes
1
answer
147
views
Compensate IMU pan/tilt
I am building quadcopter with IMU to get orientation in 3D and ultrasound range finder to measure distance to the ground. For some mechanical reasons, IMU is not aligned with quadcopter axis. Range ...
-1
votes
1
answer
380
views
glm::yaw How to get range between -180 to 180 or 360 degrees
I have a quaternion and I rotate this quaternion around the y axis.
I try to get the yaw from this quaternion and convert to degrees and it works perfectly fine... Until it gets past 90.
After it gets ...
1
vote
1
answer
167
views
Custom quaternion to Euler giving NaN
I am writing a game + game engine for a college class, and I've decided to store rotations / orientations as quaternions to prevent gimbal lock. The game is a spaceship game with rotational controls, ...
-1
votes
1
answer
303
views
Switching Coordinate Frame for Quaternions
I'm given quaternion data of an object [w, x, y, z] in the Forward Left Up (FLU) coordinate system and I would like to convert it to quaternion data in the Forward Right Down (FRD) coordinate system. ...
1
vote
1
answer
116
views
Unity C# Pendulum withRotation
I am a unity newbie, can I get some help?
So basically I created a pendulum, but i added some function where, if it reached the maximum height possible, the Y axis of the pendulum will rotate by 180 ...
0
votes
1
answer
40
views
Assets\Pinegenegrator.cs(26,80): error CS1503: Argument 4: cannot convert from 'UnityEngine.Quaternion' to 'UnityEngine.Transform'
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pinegenegrator : MonoBehaviour
{
public GameObject pinePB;
private float cd;
public float ...
1
vote
1
answer
170
views
Spawn bullets in different directions (Unity/C#)
I'm trying to create a half circle bullet spread (similar to the illustration attached IMAGE).
I'm not sure how to properly calculate angles. Right now what I have is a gun that can be aimed in any ...