euler-angles

Getting the rotation of device around the world origin's y axis in ARKit

对着背影说爱祢 提交于 2020-02-28 09:46:05
问题 I am trying to calculate the rotation of my device when I rotate it around the y-axis in ARKit. For clarification the y-axis in ARKit is the axis pointing upwards perpendicular to the ground. I used eulerangles to get the rotation of the camera like this: var alpha = sceneView.pointOfView?.eulerAngles.y This approximately works when 0=<alpha<pi/2 and when -pi/2<alpha<=0 , but for what is supposed to be other angles I get the wrong readings. I suspect this has to do with gimbal lock and that I

Roll pitch and yaw from Rotation matrix with Eigen Library

你。 提交于 2020-02-20 07:44:31
问题 I need to extract the roll pitch yaw angles from a rotation matrix and I want to be sure that what I do is correct. Eigen::Matrix< simFloat, 3, 1> rpy = orientation.toRotationMatrix().eulerAngles(0,1,2); const double r = ((double)rpy(0)); const double p = ((double)rpy(1)); const double y = ((double)rpy(2)); Is that correct? Because I was reading here: http://eigen.tuxfamily.org/dox/group__Geometry__Module.html#gad118fececd448d7485ffea4858775e5a And I was a bit confused when it says, at the

Yaw and Pitch between 2 3D points

依然范特西╮ 提交于 2020-01-22 02:34:13
问题 I have 2 3D points and I need to get Yaw and Pitch between then in radians. I've tried s many formulas but it just doesn' work. My coordinates system is the following: X= left right Y = forward backward Z = up down Any help? And please be specific. I would really appreciate the whole formula. 回答1: You can use the formulas I posted here to calculate the yaw ("heading") and pitch between to points. The only difference is that my calculations take in a single point (the other point is the origin

Conversion euler to matrix and matrix to euler

断了今生、忘了曾经 提交于 2020-01-21 01:47:29
问题 I'm trying to convert a 3D rotation described in term of euler angles into a matrix and then back, using .NET/C#. My conventions are: left handed system (x right, y top, z forward) order of rotations: heading around y, pitch around x, bank around z rotations are positive using the left hand rule (thumb pointing to +infinity) My trial is: Euler to matrix (I've removed the x,y,z translation part for simplification) Matrix3D matrix = new Matrix3D() { M11 = cosH * cosB - sinH * sinP * sinB, M12 =

Difficulty with rotating child around parent axes

坚强是说给别人听的谎言 提交于 2020-01-06 15:11:26
问题 I know there's a million questions on rotating, I've tried and read many things but I can't seem to solve this particular problem. The only way I can think to explain it properly is with some poorly drawn diagrams so here goes! I have a parent object, and a child object (here it's represented as a die where opposite faces add up to 7), the axes in this diagram are the parents X, Y, and Z directions Starting point: I want the child object to have two methods that I'll call RotateZ and RotateX

Translate Local quaternion rotation into global (gyro)

六眼飞鱼酱① 提交于 2020-01-05 05:00:12
问题 I need a way to get euler angles for rotation in global frame of reference from a local. I am using c#, wpf 3d and a gyroscope. I have a globe on the screen that should move in the same way as the gyro. Since the gyro sends movement relative to itself I need to use quaternions to keep the state of the object and update it but I'm stuck. If i do the following: var qu=eulerToQ(Gyro.X,Gyro.Y,Gyro.Z); GlobalQu = Quaternion.Multiply(qu, GlobalQu); IT rotates correctly on one axis. When I rotate by

Convert 2 3D Points to Directional Vectors to Euler Angles

廉价感情. 提交于 2020-01-02 10:15:47
问题 Here's essentially my problem. Also maybe I am not familiar enough with Euler angles and what I'm attempting to do is not possible. I have 2 points in 3d space. p1 (1,2,3) p2 (4,5,6) In order to get the unit vectors for these two points I'm doing this basically. var productX = (position.X2 - position.X1); var productY = (position.Y2 - position.Y1); var productZ = (position.Z2 - position.Z1); var normalizedTotal = Math.sqrt(productX * productX + productY * productY + productZ * productZ); var

Conversion between Euler <=> Quaternion like in Unity3d engine

梦想与她 提交于 2020-01-01 14:22:08
问题 I've used two examples (from this site too), but results are not the same as those that said Unity. Quaternion.Euler and .eulerAngles are Unity functions. FromQ doesn't perform singularity check, FromQ2 does. Results: eulers = (100,55,-11): Quaternion.Euler(eulers) == (0.6, 0.4, -0.4, 0.5) ToQ(eulers)); == (0.5, -0.4, 0.2, 0.7) // 0.5, -0.4 right but in wrong order FromQ(ToQ(eulers)) == (55.0, 100.0, -11.0) FromQ2(ToQ(eulers)) == (-55.5, -6.3, 71.0) // something right Quaternion.Euler(eulers)

html5 - Get device orientation rotation in relative coordinate

只愿长相守 提交于 2019-12-30 09:36:25
问题 I'm trying to get the change in orientation between two deviceorientation events along the left-right axis, and top-bottom axis, those axis being usually defined as the phone x and y axis (https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Orientation_and_motion_data_explained) ie between instants t1 and t2 where those phone axis move from (x1, y1) to (x2, y2) , It'd like to get (angle(x2-x1), angle(y1-y2)) . When the device is in portrait mode (in opposition to landscape mode), those

Euler angles between two 3d vectors

霸气de小男生 提交于 2019-12-20 23:21:10
问题 How do you find the 3 euler angles between 2 3D vectors? When I have one Vector and I want to get its rotation, this link can be usually used: Calculate rotations to look at a 3D point? But how do I do it when calculating them according to one another? 回答1: As others have already pointed out, your question should be revised. Let's call your vectors a and b . I assume that length(a)==length(b) > 0 otherwise I cannot answer the question. Calculate the cross product of your vectors v = a x b ; v