Euler Rotation: Difference between revisions

From Graal Bible
(Replacing page with '{{playerworld}}')
No edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{playerworld}}
[[Category:Scripting Reference]]
== Definitions ==
Euler - Pronounced Oiler; discovered that as 1 is continuously compounded, it reaches a number, ''e''. However, Euler rotation is taking a 3-dimensional axes set and rotating them about the z-axis followed by a forward or backward rotation to create a new axes set.
For objects that inherit the property 'eulerrotation', the format is supposedly "Δ''α'' Δ''β'' Δ''γ''". Read further for a better explanation.
 
 
''&theta;'': greek letter ''theta''<br />
''&phi;'': greek letter ''phi''<br />
''theta'' and ''phi'' are commonly used in trigonometry for angles (but phi is most commonly used as a constant: 1.618...).<br />
''&alpha;'': 1<sup>st</sup> greek letter ''alpha''. For our purposes, it will represent The angle between the original x axis and the normal vector<sup>(1)</sup>.<br />
''&beta;'': 2<sup>nd</sup> greek letter ''beta''. For our purposes, it will represent the forward or backward "tilt".<br />
''&gamma;'': 3<sup>rd</sup> greek letter ''gamma''. For our purposes, it will represent the angle between the normal vector<sup>(1)</sup> and the new x axis.<br />
 
Therefore, images and text could be rotated, something that could not be done before, so that said image or text would have a three-dimensional effect. If all said is true, eulerrotation = "0 -pi/3 0"; for text would project it in a Star Wars-like fashion.
 
sin(''&theta;'') = y / ''r'' (&Delta;y of a point from the center on a circle with radius ''r'')
cos(''&theta;'') = x / ''r'' (&Delta;x of a point from the center on a circle with radius ''r'')
sin(''&theta;'' &plusmn; ''&phi;'') = sin(''&theta;'') cos(''&phi;'') &plusmn; cos(''&theta;'') sin(''&phi;'')
-cos(''&theta;'' &plusmn; ''&phi;'') = -cos(''&theta;'') cos(''&phi;'') &plusmn; sin(''&theta;'') sin(''&phi;'')
 
In addition (not really useful):
tan(''&theta;'') = sin(''&theta;'') / cos(''&theta;'')
cot(''&theta;'') = cos(''&theta;'') / sin(''&theta;'')
sec(''&theta;'') = 1 / cos(''&theta;'')
csc(''&theta;'') = 1 / sin(''&theta;'')
 
<hr width="33%" NOSHADE>
<sup>(1)</sup> The normal vector is the vector perpendicular to the original z and the new z axes. This can be calculated through [[Cross Product|cross product]].
 
== Rotation Matrices ==
'''Note:''' The following example uses MATLAB notation for the matrix transformation.
[cos(''&gamma;'') sin(''&gamma;'') 0; -sin(''&gamma;'') cos(''&gamma;'') 0; 0 0 1] * ...
[1 0 0; 0 cos(''&alpha;'') sin(''&alpha;''); 0 -sin(''&alpha;'') cos(''&alpha;'')] * ...
[cos(''&beta;'') sin(''&beta;'') 0; -sin(''&beta;'') cos(''&beta;'') 0; 0 0 1] * ...
([x<sub>0</sub> y<sub>0</sub> z<sub>0</sub>]') = [x y z]'

Latest revision as of 11:11, 20 February 2010

Definitions

Euler - Pronounced Oiler; discovered that as 1 is continuously compounded, it reaches a number, e. However, Euler rotation is taking a 3-dimensional axes set and rotating them about the z-axis followed by a forward or backward rotation to create a new axes set. For objects that inherit the property 'eulerrotation', the format is supposedly "Δα Δβ Δγ". Read further for a better explanation.


θ: greek letter theta
φ: greek letter phi
theta and phi are commonly used in trigonometry for angles (but phi is most commonly used as a constant: 1.618...).
α: 1st greek letter alpha. For our purposes, it will represent The angle between the original x axis and the normal vector(1).
β: 2nd greek letter beta. For our purposes, it will represent the forward or backward "tilt".
γ: 3rd greek letter gamma. For our purposes, it will represent the angle between the normal vector(1) and the new x axis.

Therefore, images and text could be rotated, something that could not be done before, so that said image or text would have a three-dimensional effect. If all said is true, eulerrotation = "0 -pi/3 0"; for text would project it in a Star Wars-like fashion.

sin(θ) = y / r (Δy of a point from the center on a circle with radius r)
cos(θ) = x / r (Δx of a point from the center on a circle with radius r)
sin(θ ± φ) = sin(θ) cos(φ) ± cos(θ) sin(φ)
-cos(θ ± φ) = -cos(θ) cos(φ) ± sin(θ) sin(φ)

In addition (not really useful):

tan(θ) = sin(θ) / cos(θ)
cot(θ) = cos(θ) / sin(θ)
sec(θ) = 1 / cos(θ)
csc(θ) = 1 / sin(θ)

(1) The normal vector is the vector perpendicular to the original z and the new z axes. This can be calculated through cross product.

Rotation Matrices

Note: The following example uses MATLAB notation for the matrix transformation.

[cos(γ) sin(γ) 0; -sin(γ) cos(γ) 0; 0 0 1] * ...
[1 0 0; 0 cos(α) sin(α); 0 -sin(α) cos(α)] * ...
[cos(β) sin(β) 0; -sin(β) cos(β) 0; 0 0 1] * ...
([x0 y0 z0]') = [x y z]'