<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: [request] jit.euler2quat &amp; jit.quat2euler _ attribute for order of rotation</title>
		<atom:link href="http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/feed</link>
		<description></description>
		<pubDate>Thu, 20 Jun 2013 05:29:47 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-64260</guid>
					<title><![CDATA[[request] jit.euler2quat &amp; jit.quat2euler _ attribute for order of rotation]]></title>
					<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-64260</link>
					<pubDate>Thu, 06 Sep 2012 18:12:18 +0000</pubDate>
					<dc:creator>Spa</dc:creator>

					<description>
						<![CDATA[
						<p>it seems that the order of rotation used in jit.euler2quat is YZX:<br />
first X rot, second Z rot, third Y rot<br />
so X is the bank (tilt) axe.</p>
<p>there is 12 rotation order possibilities.</p>
<p>A convenient order of rotation for openGL, when object is facing the camera is YXZ:<br />
first Z rot, second X rot, third Y rot<br />
It is more logical to use this order, respect to the direction and lookat attributes of jit.anim.node that use the Z axis of the object.<br />
so Z is the bank (tilt) axe.</p>
<p>Could you create an attribute for those 2 objects like:  rotation_order (default: yzx,  yxz etc&#8230;)<br />
or make an object like jit.eulerYXZ2quat and jit.quat2eulerYXZ<br />
or perhaps send me or make the code public for jit.euler2quat &#038; jit.quat2euler, so i can adapt them.</p>
<p>thanks</p>
<p>I created a mxj for this:</p>
<p>	public final void yxz_r(double x, double y, double z) {<br />
		// Y : heading, X : attitude, Z : bank<br />
		// enter: XYZ _ order process: YXZ<br />
		// first Z rot, second X rot, third Y rot, for jitter conveniences<br />
		// Assuming the angles are in radians.</p>
<p>		double sx = Math.sin(x/2);<br />
		double cx = Math.cos(x/2);<br />
		double sy = Math.sin(y/2);<br />
		double cy = Math.cos(y/2);<br />
		double sz = Math.sin(z/2);<br />
		double cz = Math.cos(z/2);</p>
<p>		// R= Qx*Qz  _ first Zrot then Xrot<br />
		// double Rx = cz*sx;<br />
		//double Ry = -sz*sx;<br />
		//double Rz = sz*cx;<br />
		//double Rw = cz*cx;</p>
<p>	    // R= Qy*Qxz  first XZrot then Yrot<br />
	  	//qx = Rx*cy+Rz*sy;<br />
		//qy = Rw*sy+Ry*cy;<br />
		//qz = -Rx*sy+Rz*cy;<br />
	    //qw = Rw*cy-Ry*sy;</p>
<p>	    // R= Qy*Qx*Qz  first Zrot then Xrot then Yrot<br />
	  	qx = cz*sx*cy+sz*cx*sy;<br />
		qy = cz*cx*sy-sz*sx*cy;<br />
	        qz = -cz*sx*sy+sz*cx*cy;<br />
	        qw = cz*cx*cy+sz*sx*sy;</p>
<p>		quat_out();<br />
	}</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231701</guid>
					<title><![CDATA[Re: [request] jit.euler2quat &#038; jit.quat2euler _ attribute for order of rotation]]></title>
					<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231701</link>
					<pubDate>Thu, 06 Sep 2012 20:22:15 +0000</pubDate>
					<dc:creator>Rob Ramirez</dc:creator>

					<description>
						<![CDATA[
						<p>hello Spa.<br />
i have logged a feature request for a rotation-order attribute to the quaternion objects.</p>
<p>our implementation is more or less derived from this website:</p>
<p><a href="http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/" rel="nofollow">http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231702</guid>
					<title><![CDATA[Re: [request] jit.euler2quat &#038; jit.quat2euler _ attribute for order of rotation]]></title>
					<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231702</link>
					<pubDate>Thu, 06 Sep 2012 21:58:14 +0000</pubDate>
					<dc:creator>Spa</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks Robert.</p>
<p>Is it possible to have a code example of these objects, so i could use them as base for developing similar objects.</p>
<p>thanks</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231703</guid>
					<title><![CDATA[Re: [request] jit.euler2quat &#038; jit.quat2euler _ attribute for order of rotation]]></title>
					<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231703</link>
					<pubDate>Thu, 06 Sep 2012 22:53:50 +0000</pubDate>
					<dc:creator>Rob Ramirez</dc:creator>

					<description>
						<![CDATA[
						<p>i&#8217;m not sure what you are asking.<br />
the website i linked to has sample code.<br />
your mxj code you posted should also work fine.</p>
<p>if you want to develop externals, the sdk is the place to start:</p>
<p><a href="http://cycling74.com/products/sdk/" rel="nofollow">http://cycling74.com/products/sdk/</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231704</guid>
					<title><![CDATA[Re: [request] jit.euler2quat &#038; jit.quat2euler _ attribute for order of rotation]]></title>
					<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231704</link>
					<pubDate>Thu, 06 Sep 2012 23:09:03 +0000</pubDate>
					<dc:creator>Spa</dc:creator>

					<description>
						<![CDATA[
						<p>I just wanted the jit.euler2quat and jit.quat2euler source code &#8230;<br />
mxj seems 4 times slower than native objects, due to bridge from max to java i suppose.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231705</guid>
					<title><![CDATA[Re: [request] jit.euler2quat &#038; jit.quat2euler _ attribute for order of rotation]]></title>
					<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-231705</link>
					<pubDate>Tue, 11 Sep 2012 13:58:14 +0000</pubDate>
					<dc:creator>Spa</dc:creator>

					<description>
						<![CDATA[
						<p>well, i suppose it was a bit short to include it in the 6.0.7 release.<br />
Hope it will appear in the next one.<br />
thanxs</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-253346</guid>
					<title><![CDATA[Reply To: [request] jit.euler2quat &amp; jit.quat2euler _ attribute for order of rotation]]></title>
					<link>http://cycling74.com/forums/topic/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation/#post-253346</link>
					<pubDate>Wed, 19 Jun 2013 19:37:00 +0000</pubDate>
					<dc:creator>Rob Ramirez</dc:creator>

					<description>
						<![CDATA[
						<p>with 6.1.3, jit.euler2quat and quat2euler have an attribute called @rotate_order, allowing you to specify the order rotations are applied.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

