SIQuaternion.GetXYZAngleValues

Introduced

v3.5

Description

Returns the X,Y,Z Euler angles (in radians) for this quaternion.

Warning: Scripting languages that do not support output arguments (JScript, PerlScript and PythonScript) should use the alternative method SIQuaternion.GetXYZAngleValues2.

C# Syntax

SIQuaternion.GetXYZAngleValues( Object& in_vX, Object& in_vY, Object& in_vZ );

Scripting Syntax

SIQuaternion.GetXYZAngleValues( x, y, z );

Parameters

Parameter Type Description
x Double X Euler angle in radians
y Double Y Euler angle in radians
z Double Z Euler angle in radians

Examples

VBScript Example

option explicit
	' CREATE OBJECTS A & B
	dim A : set A = ActiveSceneRoot.AddNull("A")
	dim B : set B = ActiveSceneRoot.AddNull("B")
	' GET GLOBAL TRANSFORM OF A & B
	dim gksA : set gksA = A.kinematics.global 
	dim gksB : set gksB = B.kinematics.global 
	dim tgA : set tgA = gksA.transform
	dim tgB : set tgB = gksB.transform
	' TRANSLATE & ROTATE A
	dim vA : set vA = XSIMath.CreateVector3(2, 2, 0)
	tgA.SetTranslation vA 		
	dim rA : set rA = XSIMath.CreateRotation( 0, 0, XSIMath.DegreesToRadians( 45 ) )
	tgA.SetRotation rA 
	gksA.transform = tgA
	' GET LOCAL TRANSFORM OF B RELATIVE TO A
	dim mA : set mA = XSIMath.CreateMatrix3
	dim mB : set mB = XSIMath.CreateMatrix3
	tgA.GetRotationMatrix3 mA
	tgB.GetRotationMatrix3 mB
	mA.TransposeInPlace()
	mB.MulInPlace mA 
	' GET ORIENTATION OF B RELATIVE TO A AS A QUATERNION
	dim qB : set qB = XSIMath.CreateQuaternion
	mB.GetQuaternion qB
	' log result
	dim x,y,z : qB.GetXYZAngleValues x, y, z
	Application.LogMessage( "R(" & _
		XSIMath.RadiansToDegrees(x) & "," & _
		XSIMath.RadiansToDegrees(y) & "," & _
		XSIMath.RadiansToDegrees(z) & ")" )

See Also

SIQuaternion.GetXYZAngleValues2 SIQuaternion.SetFromXYZAngleValues