euler-angles

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:

Android FaceDetector.Face Euler angles are 0 all the time

拈花ヽ惹草 提交于 2019-12-13 17:06:16
问题 I'm trying to get a the Euler angle of a Face that is detected by FaceDetector. Here is what I use to output to Logcat: Log.v("debug", " X: " + face.pose(Face.EULER_X) + " Y: " + face.pose(Face.EULER_Y) + " Z: " + face.pose(Face.EULER_Z) ); But it always returns 0.0 for all three, no matter what angle the face is at. Any ideas why? 回答1: Yeah the FaceDetector from API 1 never returns a pose angle. You can look at the source code to verify. The newer FaceDetectionListener from API 14 will

Given a set of Euler Angles, (Pitch, Yaw, Roll) how to find alternate set that describes same 3D orientation?

时光怂恿深爱的人放手 提交于 2019-12-13 06:32:03
问题 I have a nice quaternion to euler equation that is sometimes returning a non-intuitive set of angles. For example: Pitch: 129 Yaw: -85 Roll: 126 I would like to programatically find alternate rotations such that Pitch and Roll are between -90 and 90. Yaw can be 0 to 360. [EDIT] Pitch is constrained to -90 to +90 and Roll is constrained to -180 to +180. 回答1: Basically, you want to prevent the orientation to go beyond the pole. It is very easy to do that: First, check if pitch is beyond the

Rotate 3D Euler point using Quaternions to avoid gimbal lock

谁都会走 提交于 2019-12-13 05:18:20
问题 Firstly, I have done much googling and checking other stackoverflow posts about this, but cannot get a working reply or a snippet of working code. Maths is not my strength. I need to have a routine that takes a camera point (CX,CY,CZ) and rotate it about a lookat point (LX,LY,LZ) by three rotation angles (RX,RY,RZ). Using euler rotations leads to gimbal lock in some cases which I need to avoid. So I heard about using quaternions. I found this to convert the rotations into a quaternion http:/

3D Math: Calculate Bank (Roll) angle from Look and Up orthogonal vectors

别说谁变了你拦得住时间么 提交于 2019-12-12 17:24:52
问题 I hope this is the proper location to ask this question which is the same as this one, but expressed as pure math instead of graphically (at least I hope I translated the problem to math correctly). Considering: two vectors that are orthogonal: Up (ux, uy, uz) and Look (lx, ly, lz) a plane P which is perpendicular to Look (hence including Up) Y1 which is the projection of Y (vertical axis) along Look onto P Question: what is the value of the angle between Y1 and Up? As mathematicians will

Quaternion to EulerXYZ, how to differentiate the negative and positive quaternion

人走茶凉 提交于 2019-12-11 13:45:10
问题 I've been trying to figure out the difference between these, and why ToEulerXYZ does not get the right rotation. Using MathGeoLib: axisX: x 0.80878228 float y -0.58810818 float z 0.00000000 float axisY: x 0.58811820 float y 0.80877501 float z 0.00000000 float axisZ: x 0.00000000 float y 0.00000000 float z 1.0000000 float Code: Quat aQ = Quat::RotateAxisAngle(axisX, DegToRad(30)) * Quat::RotateAxisAngle(axisY, DegToRad(60)) * Quat::RotateAxisAngle(axisZ, DegToRad(40)); float3 eulerAnglesA = aQ

Rotation order for eulers getPitch(), getRoll(), getYaw() from Quaternion in libgdx?

柔情痞子 提交于 2019-12-11 03:41:10
问题 When transforming a quaternion to Euler Angles, usually there has to be a order in which the axes are rotated, like in this visualization. How does it work for libgdx? The Quaternion class has the functions getRoll(): Math.asin(MathUtils.clamp(2f * (w*x - z * y), -1f, 1f)) : (float)pole * MathUtils.PI * 0.5f;` getPitch(): Math.asin(MathUtils.clamp(2f * (w*x - z * y), -1f, 1f)) : (float)pole * MathUtils.PI * 0.5f;` getYaw(): ` MathUtils.atan2(2f * (y * w + x * z), 1f - 2f * (y * y + x * x)) :

Converting yaw Euler angles in range [-90, 90] to [0, 360]

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:11:47
问题 Is it possible to convert the yaw Euler angle got from the Bullet physics engine using btTransform trans; trans.getBasis().getEulerYPR(rx, ry, rz); into the range [0 , 360]. Otherwise for a 360 deg rotation I get the Euler angle varying from 0->90->0-> -90 -> 0 but I want from 0->90->180->270->0 My graphics API only accepts rotation angles in the range of 0 to 360 Well, the 0->90->0-> -90 was the pitch value. Here is the code I use now : trans.getBasis().getEulerYPR(yaw, pitch, roll); y1 =

Gimbal Lock how does it happen?

和自甴很熟 提交于 2019-12-11 01:58:10
问题 So I searched on the net and I'm having some problems imagining how the gimbal-lock occurs. According to what i saw, it occurs when 2 or more axes align losing a degree of freedom but I can't imagine how will the axes even begin to align? I mean, when i rotate an object around x-axis (for example) doesn't the y and z axes rotate with the X-axis to remain perpendicular? How are they gonna align? Similarly whenever i rotate around Y or Z axis the other 2 axis rotate together and remain

Convert yaw, pitch AND roll to x,y,z vector in world coordinates

半城伤御伤魂 提交于 2019-12-07 05:09:51
问题 I'm working on some simple 3d graphics in OpenGL (java LWGJL), and I'm trying to figure out how to convert yaw, pitch and roll to the x, y and z components of my movement Vector. I know how to do this with just pitch and yaw (as explained here), but I haven't found anything the explains how to integrate roll into this formula. I am aware that yaw and pitch are all that is needed to define a vector in 3d space, but I also need roll in this instance. I have keys bound to different movements