quaternions

Arcball Rotation at 90 degrees

血红的双手。 提交于 2019-12-22 00:37:31
问题 I have successfully implemented Arcball rotation through quaternions, but am confused at what to do when the direction vector of the camera is parallel to up vector. Currently I am just restricting the rotation along the x-axis (the pitch) when the dot product of the direction vector and the up vector exceeds 0.99. In Maya (or Max, XSI where arcball rotation is used) for example, you can rotate around in a full circle very smoothly. I am hoping for a solution similar to that of Maya's

Quaternion from Tait-Bryan angles

孤街醉人 提交于 2019-12-21 20:27:24
问题 I am writing a camera with SharpDX and rotate it with the help of a quaternion. The camera rotation is set with pitch (X rotation), yaw (Y rotation) and roll (Z rotation), so called "Tiat-Bryan" angles (these are not Euler angles which would have an XYX rotation, and not XYZ). I am using a left-handed coordinate system: X+ is rightwards, Y+ is upwards, Z+ is downwards the screen. If I rotate around X ("pitching"), positive values make the camera look downwards. If I rotate around Y ("yawing")

How do you rotate 2 quaternions back to starting position and then calculate the relative rotation?

一曲冷凌霜 提交于 2019-12-21 16:47:18
问题 I have 2 IMU's (Inertial measurement units) and I want to calculate their relative rotation. Unfortunately, the output of the IMU's gives me both quaternions relative to global (I'm assuming that's how quaternions work). However, I need measurements of the rotation of one of the sensors relative to the other. All the while, these two sensors have been rotated from their initial orientation in the global axis. For example: I have one sensor attached to the chest and the other attached the arm.

How to avoid roll in SceneKit camera controlled by Core Motion?

自作多情 提交于 2019-12-21 12:54:08
问题 I'm setting my SceneKit camera to the current CMDeviceMotion attitude using the CMDeviceMotion extension described in this answer: func deviceDidMove(motion: CMDeviceMotion?, error: NSError?) { if let motion = motion { let orientation = motion.gaze(atOrientation: UIApplication.sharedApplication().statusBarOrientation) cameraNode.orientation = orientation } } This works beautifully, however, I'd like to block the rotation (roll) and only allow the camera to turn around (yaw) and pitch. I tried

Euler to Quaternion / Quaternion to Euler using Eigen

老子叫甜甜 提交于 2019-12-20 14:43:54
问题 I'm trying to implement a functionality that can convert an Euler angle into an Quaternion and back "YXZ"-convention using Eigen. Later this should be used to let the user give you Euler angles and rotate around as Quaternion and convert Back for the user. In fact i am realy bad at math but tried my best. I have no Idea if this matrices are correct or anything. The code Works, but my results are way to off, i suppose. Any idea where i take the wrong turn? This is what my Quat.cpp looks like:

rotating a quaternion on 1 axis?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 10:34:35
问题 I have a model rotated by a quaternion. I can only set the rotation, I can't add or subtract from anything. I need to get the value of an axis, and than add an angle to it (maybe a degree or radian?) and than re-add the modified quaternion. How can I do this? (answer on each axis). 回答1: You can multiply two quaternions together to produce a third quaternion that is the result of the two rotations. Note that quaternion multiplication is not commutative, meaning order matters (if you do this in

Creating uniform random quaternion and multiplication of two quaternions

ぐ巨炮叔叔 提交于 2019-12-20 04:25:25
问题 I have a python (NumPy) function which creates a uniform random quaternion. I would like to get two quaternion multiplication as 2-dimensional returned array from the same or an another function. The formula of quaternion multiplication in my recent case is Q1*Q2 and Q2*Q1. Here, Q1=(w0, x0, y0, z0) and Q2=(w1, x1, y1, z1) are two quaternions. The expected two quaternion multiplication output (as 2-d returned array) should be return([-x1*x0 - y1*y0 - z1*z0 + w1*w0, x1*w0 + y1*z0 - z1*y0 + w1

Incorrect conversion from quaternions to euler angles and back

a 夏天 提交于 2019-12-19 21:32:27
问题 I am converting angles-axis representation to Euler angles. I decided to check and make sure that the Euler angles I got from the conversion would lead back to the original axis-angle. I print out the values, but they do not match! I have read http://forum.onlineconversion.com/showthread.php?t=5408 and http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles as well as similar conversion questions on this website. In the code below I start with angle 'angle' and axis (rx

Calculate Quaternion Inverse [closed]

混江龙づ霸主 提交于 2019-12-19 14:56:10
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . Hi i'm trying to figure out how to calculate the inverse of a quaternion. A code example would be awesome. Cheers 回答1: See Wikipedia article for the entire Quaternion math. Don't know what language you want to

Use Quaternions to compute yaw, pitch and roll from iphone?

爱⌒轻易说出口 提交于 2019-12-19 11:23:21
问题 I have seen many questions and articles mentioning that Quaternions can be used to derive better,accurate and stable yaw, pitch and roll readings from the iPhone rather than reading it's direct yaw, pitch and roll readings. But at the same time, I haven't seen any proper methods of implementing Quaternions in iPhone platform. As a beginner, It's really hard to know, How these Quaternions works and implementing them in a piece of code? (Sorry for not providing any code as i have no idea of how