<?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/9802" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2014-03-01T01:50:34+00:00</updated>

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

		<entry>
		<author><name><![CDATA[nipo]]></name></author>
		<updated>2014-03-01T01:50:34+00:00</updated>

		<published>2014-03-01T01:50:34+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33054#p33054</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33054#p33054"/>
		<title type="html"><![CDATA[Initial quaternion from basis.]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33054#p33054"><![CDATA[
Hi all,<br>A bit novice question, please excuse me if this is covered some place, did not find it.<br>I have an oriented bounding box that I am trying to derive a rigid body from. I know its center and its three axis.  I followed bullet API/demos but seems to have problems with the initial quaternion orientation. What I do is setup the rotation matrix with the three ortho-normal vectors. Take transpose to get the inverse of rotation. Then call getRotation() to get back the quaternion representing the rotation matrix. However the quaternion is not what i expect. Using the first of the matrix basis vectors, and rotating it by the quaternion, I would expect to end up in (1,0,0) yet, thats not the case. Anything I am doing completely wrong? Thank you!<br><br>Here is an example:<br><div class="codebox"><p>Code: </p><pre><code>v1.setValue(0.94085854,-0.21149139,0.26468223);v2.setValue(-0.28753003,-0.085231327,0.95397180);v3.setValue(0.17919759,0.97365654,0.14100073);btMatrix3x3 mtx(v1.getX(),v1.getY(), v1.getZ(),v2.getX(),v2.getY(), v2.getZ(),v3.getX(),v3.getY(), v3.getZ());mtx = mtx.transpose();btQuaternion rot;mtx.getRotation(rot);rot.normalize();btQuaternion invrot;invrot = rot.inverse();btQuaternion point(v1.getX(),v1.getY(),v1.getZ(),0);point = rot*point*invrot; //Result is point = (0.92, -0.13, 0.34)</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10742">nipo</a> — Sat Mar 01, 2014 1:50 am</p><hr />
]]></content>
	</entry>
	</feed>
