<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13040" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2020-07-28T03:34:14+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13040</id>

		<entry>
		<author><name><![CDATA[water]]></name></author>
		<updated>2020-07-28T03:34:14+00:00</updated>

		<published>2020-07-28T03:34:14+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43051#p43051</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43051#p43051"/>
		<title type="html"><![CDATA[Re: How to change Eulerian angle yzx]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43051#p43051"><![CDATA[
Thank you very much for your reply. I think I didn't express it clearly, but now I have found a solution.I changed the order of rotation to achieve the effect I wanted<br><br>//zxy<br>void setEulerZXY(const btScalar&amp; yaw, const btScalar&amp; pitch, const btScalar&amp; roll)<br>{<br>btScalar halfYaw = btScalar(yaw) * btScalar(0.5);<br>btScalar halfPitch = btScalar(pitch) * btScalar(0.5);<br>btScalar halfRoll = btScalar(roll) * btScalar(0.5);<br>btScalar cosy = btCos(halfYaw);<br>btScalar siny = btSin(halfYaw);<br>btScalar cosx = btCos(halfPitch);<br>btScalar sinx = btSin(halfPitch);<br>btScalar cosz = btCos(halfRoll);<br>btScalar sinz = btSin(halfRoll);<br>/*setValue(cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw,<br>cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw,<br>sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw,<br>cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);*/<br>setValue(cosz * sinx * cosy - sinz * cosx * siny,<br>cosz * cosx * siny + sinz * sinx * cosy,<br>sinz * cosx * cosy + cosz * sinx * siny,<br>cosz * cosx * cosy - sinz * sinx * siny);<br><br>}<br>[/code]<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13653">water</a> — Tue Jul 28, 2020 3:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2020-07-23T16:18:41+00:00</updated>

		<published>2020-07-23T16:18:41+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43050#p43050</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43050#p43050"/>
		<title type="html"><![CDATA[Re: How to change Eulerian angle yzx]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43050#p43050"><![CDATA[
I don't know how to do what you asked off the top of my head.  It sounds... possible, but complicated.  There are many different varieties of "Euler angles" and you'd have to define exactly what you mean.  For example... are the axes of your Y, then Z, then X rotations in the world-frame or the object local-frame?  As I recall Euler himself used a strategy which was: local+world-frame (they are the same at the start), then local-frame, then world-frame.  But no one in the games industry uses his formulation and instead use "yaw, pitch, roll" about local-frame axes and call it "Euler angles".<br><br>All of that ^^^ just to say: Euler angles are complicated and you haven't clearly defined your system.  Any solution would have to know <strong class="text-strong">exactly</strong> what you mean.<br><br>Unless you're doing something very special where Euler angles are a natural coordinate system for your mechanism/application I would advise: don't use them and instead use Quaternions and do  "rotation math".  It may sound intimidating, but from my experience its implementation is simpler than an Eulerian approach.  In particular: there are no gimbal-lock singularities to worry about.<br><br>So I would ask:  <strong class="text-strong">What do you really want to do?</strong><br><br><strong class="text-strong">(1)</strong> Are you trying to rotate an object in some fashion?  (e.g. you know where you're going and want rotate toward it) Or...<br><br><strong class="text-strong">(2)</strong> Are you trying to "measure" the rotation of an object?  (e.g. you know where you are but want to know it in a different coordinate space)<br><br>If <strong class="text-strong">(1)</strong> then you <strong class="text-strong">definitely</strong> should be using rotation math and should avoid Euler angles.  If <strong class="text-strong">(2)</strong> then <strong class="text-strong">(a)</strong> Really?  Why? and <strong class="text-strong">(b)</strong> you <strong class="text-strong">probably</strong> should use rotation math to compute your Eulerian decomposition.  The only alternative methodology I can think of would be to do a bunch of geometry/trigonometry.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Thu Jul 23, 2020 4:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[water]]></name></author>
		<updated>2020-07-23T06:23:06+00:00</updated>

		<published>2020-07-23T06:23:06+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43049#p43049</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43049#p43049"/>
		<title type="html"><![CDATA[How to change Eulerian angle yzx]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43049#p43049"><![CDATA[
In the bullet, his Euler angle seems to be YXZ. What should I do to change him into YZX,thank you very much<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13653">water</a> — Thu Jul 23, 2020 6:23 am</p><hr />
]]></content>
	</entry>
	</feed>
