﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AAligorith%2FEulerRotationOrder</id>
	<title>利用者:Aligorith/EulerRotationOrder - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AAligorith%2FEulerRotationOrder"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Aligorith/EulerRotationOrder&amp;action=history"/>
	<updated>2026-08-13T23:15:06Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Aligorith/EulerRotationOrder&amp;diff=90401&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Aligorith/EulerRotationOrder&amp;diff=90401&amp;oldid=prev"/>
		<updated>2018-06-28T18:43:10Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 18:43時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Aligorith/EulerRotationOrder&amp;diff=90400&amp;oldid=prev</id>
		<title>wiki&gt;Aligorith: /* Euler Rotation Orders */</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Aligorith/EulerRotationOrder&amp;diff=90400&amp;oldid=prev"/>
		<updated>2009-09-01T12:12:46Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Euler Rotation Orders&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Euler Rotation Orders ==&lt;br /&gt;
When defining rotations as 'eulers' (i.e. 3 rotational angles defined in terms of each other), different permutations of combining the rotations can be useful in different situations. The &amp;quot;classic&amp;quot; implementation in Blender uses the &amp;quot;XYZ&amp;quot; order.&lt;br /&gt;
&lt;br /&gt;
For more details on this matter, see:&lt;br /&gt;
http://en.wikipedia.org/wiki/Euler_angles&lt;br /&gt;
&lt;br /&gt;
== Overview of Proposed (New) System ==&lt;br /&gt;
The base code for this has been adapted from:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ANSI C code from the article&lt;br /&gt;
&amp;quot;Euler Angle Conversion&amp;quot;&lt;br /&gt;
by Ken Shoemake, shoemake@graphics.cis.upenn.edu&lt;br /&gt;
in &amp;quot;Graphics Gems IV&amp;quot;, Academic Press, 1994&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes about changes made to this code:&lt;br /&gt;
* Only the 'static' frame rotations have been used, and repeating axes have been left out for now. These could be restored, but the original code will need to be referenced again to find the parts that have been left out of the adapted implementation.&lt;br /&gt;
* A major departure from the original code is the way in which rotation orders are defined. It is much more convenient in our code to define an enum of the possible rotation orders, and use this enum to provide access-indices to an array containing static structs with the values that needed to be packed/un-packed from the ordinals used in Shoemake's code. The C-code used to provide the necessary mapping used to generate the adapted code is presented in a later section.&lt;br /&gt;
* The matrices used in Shoemake's code have been transposed (compared to Blender's original matrices). The result was that naively copying Shoemake's code with the modifications above, will result in objects/bones rotating in a direction opposite to the original code (i.e. Blender originally rotates clockwise, but Shoemake's code is counter-clockwise)&lt;br /&gt;
&lt;br /&gt;
== Code used to provide mapping from Shoemake's code to Blender's code ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* Test code for Euler rotations with custom rotation order */&lt;br /&gt;
&lt;br /&gt;
/* ---------------------------------------- */&lt;br /&gt;
/* Ken Shoemake code */&lt;br /&gt;
&lt;br /&gt;
// ken defines these constants too&lt;br /&gt;
#define X 0&lt;br /&gt;
#define Y 1&lt;br /&gt;
#define Z 2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** Order type constants, constructors, extractors ***/&lt;br /&gt;
    /* There are 24 possible conventions, designated by:    */&lt;br /&gt;
    /*	  o EulAxI = axis used initially		    */&lt;br /&gt;
    /*	  o EulPar = parity of axis permutation		    */&lt;br /&gt;
    /* Axes I,J,K will be a permutation of X,Y,Z.	    */&lt;br /&gt;
    /* Axis H will be either I or K, depending on EulRep.   */&lt;br /&gt;
    /* Frame S takes axes from initial static frame.	    */&lt;br /&gt;
    /* If ord = (AxI=X, Par=Even, Rep=No, Frm=S), then	    */&lt;br /&gt;
    /* {a,b,c,ord} means Rz(c)Ry(b)Rx(a), where Rz(c)v	    */&lt;br /&gt;
    /* rotates v around Z by c radians.			    */&lt;br /&gt;
#define EulFrmS	     0&lt;br /&gt;
#define EulFrmR	     1&lt;br /&gt;
#define EulFrm(ord)  ((unsigned)(ord)&amp;amp;1)&lt;br /&gt;
#define EulRepNo     0&lt;br /&gt;
#define EulRepYes    1&lt;br /&gt;
#define EulRep(ord)  (((unsigned)(ord)&amp;gt;&amp;gt;1)&amp;amp;1)&lt;br /&gt;
#define EulParEven   0&lt;br /&gt;
#define EulParOdd    1&lt;br /&gt;
#define EulPar(ord)  (((unsigned)(ord)&amp;gt;&amp;gt;2)&amp;amp;1)&lt;br /&gt;
#define EulSafe	     &amp;quot;\000\001\002\000&amp;quot;&lt;br /&gt;
#define EulNext	     &amp;quot;\001\002\000\001&amp;quot;&lt;br /&gt;
#define EulAxI(ord)  ((int)(EulSafe[(((unsigned)(ord)&amp;gt;&amp;gt;3)&amp;amp;3)]))&lt;br /&gt;
#define EulAxJ(ord)  ((int)(EulNext[EulAxI(ord)+(EulPar(ord)==EulParOdd)]))&lt;br /&gt;
#define EulAxK(ord)  ((int)(EulNext[EulAxI(ord)+(EulPar(ord)!=EulParOdd)]))&lt;br /&gt;
#define EulAxH(ord)  ((EulRep(ord)==EulRepNo)?EulAxK(ord):EulAxI(ord))&lt;br /&gt;
    /* EulGetOrd unpacks all useful information about order simultaneously. */&lt;br /&gt;
#define EulGetOrd(ord,i,j,k,h,n,s,f) \&lt;br /&gt;
	{\&lt;br /&gt;
		unsigned o=ord;\&lt;br /&gt;
		f=o&amp;amp;1;o&amp;gt;&amp;gt;=1;\&lt;br /&gt;
		s=o&amp;amp;1;o&amp;gt;&amp;gt;=1;\&lt;br /&gt;
		n=o&amp;amp;1;o&amp;gt;&amp;gt;=1;\&lt;br /&gt;
		i=EulSafe[o&amp;amp;3];\&lt;br /&gt;
		j=EulNext[i+n];\&lt;br /&gt;
		k=EulNext[i+1-n];\&lt;br /&gt;
		h=s?k:i;\&lt;br /&gt;
	}&lt;br /&gt;
    /* EulOrd creates an order value between 0 and 23 from 4-tuple choices. */&lt;br /&gt;
#define EulOrd(i,p,r,f)	   (((((((i)&amp;lt;&amp;lt;1)+(p))&amp;lt;&amp;lt;1)+(r))&amp;lt;&amp;lt;1)+(f))&lt;br /&gt;
    /* Static axes */&lt;br /&gt;
#define EulOrdXYZ    EulOrd(X,EulParEven,EulRepNo,EulFrmS)&lt;br /&gt;
#define EulOrdXYX    EulOrd(X,EulParEven,EulRepYes,EulFrmS)&lt;br /&gt;
#define EulOrdXZY    EulOrd(X,EulParOdd,EulRepNo,EulFrmS)&lt;br /&gt;
#define EulOrdXZX    EulOrd(X,EulParOdd,EulRepYes,EulFrmS)&lt;br /&gt;
#define EulOrdYZX    EulOrd(Y,EulParEven,EulRepNo,EulFrmS)&lt;br /&gt;
#define EulOrdYZY    EulOrd(Y,EulParEven,EulRepYes,EulFrmS)&lt;br /&gt;
#define EulOrdYXZ    EulOrd(Y,EulParOdd,EulRepNo,EulFrmS)&lt;br /&gt;
#define EulOrdYXY    EulOrd(Y,EulParOdd,EulRepYes,EulFrmS)&lt;br /&gt;
#define EulOrdZXY    EulOrd(Z,EulParEven,EulRepNo,EulFrmS)&lt;br /&gt;
#define EulOrdZXZ    EulOrd(Z,EulParEven,EulRepYes,EulFrmS)&lt;br /&gt;
#define EulOrdZYX    EulOrd(Z,EulParOdd,EulRepNo,EulFrmS)&lt;br /&gt;
#define EulOrdZYZ    EulOrd(Z,EulParOdd,EulRepYes,EulFrmS)&lt;br /&gt;
&lt;br /&gt;
/* ---------------------------------------- */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* // Structure for euler orders we're trying to make...&lt;br /&gt;
typedef struct EulerOrderData {&lt;br /&gt;
	short i;	// first axis&lt;br /&gt;
	short j;	// second axis&lt;br /&gt;
	short k;	// third axis&lt;br /&gt;
	&lt;br /&gt;
	short h;	// ???&lt;br /&gt;
	&lt;br /&gt;
	short n;	// even/odd?&lt;br /&gt;
	short s;	// repeats?&lt;br /&gt;
	short f;	// rotating or static axes&lt;br /&gt;
} EulerOrderData; &lt;br /&gt;
&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* macro to give a printout of each rotation order */&lt;br /&gt;
#define PrintEulOrders(A) \&lt;br /&gt;
	{\&lt;br /&gt;
		int i,j,k,h,n,s,f; \&lt;br /&gt;
		printf(&amp;quot;%s - %d\n&amp;quot;, #A, EulOrd##A); \&lt;br /&gt;
		EulGetOrd(EulOrd##A, i,j,k, h, n,s,f)\&lt;br /&gt;
		printf(&amp;quot;\t{%d, %d, %d,  %d,  %d, %d, %d} // %s\n&amp;quot;, i, j, k,  h,  n, s, f,  #A); \&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
int main (int argv, char **argc)&lt;br /&gt;
{&lt;br /&gt;
	/* go through each type... */&lt;br /&gt;
	PrintEulOrders(XYZ)&lt;br /&gt;
	PrintEulOrders(XYX)  &lt;br /&gt;
	PrintEulOrders(XZX)  &lt;br /&gt;
	PrintEulOrders(YZX)  &lt;br /&gt;
	PrintEulOrders(YZY)    &lt;br /&gt;
	PrintEulOrders(YXZ)    &lt;br /&gt;
	PrintEulOrders(YXY)    &lt;br /&gt;
	PrintEulOrders(ZXY)   &lt;br /&gt;
	PrintEulOrders(ZXZ)   &lt;br /&gt;
	PrintEulOrders(ZYX)    &lt;br /&gt;
	PrintEulOrders(ZYZ)   &lt;br /&gt;
	&lt;br /&gt;
	/* done.. */&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage of Rotation Orders ==&lt;br /&gt;
In &amp;lt;code&amp;gt;BLI_arithb.h&amp;lt;/code&amp;gt;, a list of defines for the possible (implemented) rotation orders is given in the enum &amp;lt;code&amp;gt;eEulerRotationOrders&amp;lt;/code&amp;gt;. These values should be supplied as the 'order' argument for the relevant calls when converting to/from eulers.&lt;br /&gt;
&lt;br /&gt;
The defines in this enum should match those given in &amp;lt;code&amp;gt;ePchan_RotMode&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;DNA_action_types.h&amp;lt;/code&amp;gt;), with the latter having a few extra options (Quaternions, Axis-Angle, etc.).&lt;br /&gt;
&lt;br /&gt;
For compatability, most tools in Blender should still just use the default XYZ rotation order still when dealing with Eulers. Only tools dealing directly with Object/Bone rotations (bones in particular, at the time of writing) need care to take into account rotation orders of the said parts when performing operations.&lt;br /&gt;
&lt;br /&gt;
The following tools/code are most affected:&lt;br /&gt;
* Constraints -&amp;gt; especially Copy/Limit Rotation constraints...&lt;br /&gt;
* Transform -&amp;gt; this is still a bit patchy now (for bones support)&lt;br /&gt;
&lt;br /&gt;
Obviously, PoseChannels and Objects are going to be affected too. For the initial round of improvements though, only PoseChannels will be touched, to reduce the errors/breakage that occurs when too many things are touched at once.&lt;/div&gt;</summary>
		<author><name>wiki&gt;Aligorith</name></author>
		
	</entry>
</feed>