XSIMath.MapObjectOrientationToWorldSpace
 
 
 

XSIMath.MapObjectOrientationToWorldSpace

Description

Converts an Orientation described in a given ObjectSpace to WorldSpace.

C# Syntax

SIVector3 XSIMath.MapObjectOrientationToWorldSpace( SITransformation in_pObjectSpace, SIVector3 in_pOrientation );

Scripting Syntax

oReturn = XSIMath.MapObjectOrientationToWorldSpace( ObjectSpace, Orientation );

Return Value

SIVector3 (orientation)

Parameters

Parameter Type Description
ObjectSpace SITransformation ObjectSpace in which the orientation is described.
Orientation SIVector3 Orientation to convert.

Examples

1. JScript Example

NewScene(null, false);
var oRoot = Application.ActiveSceneRoot;
var oCube = oRoot.AddGeometry("Cube","MeshSurface");
oCube.Kinematics.Global.Parameters("posy").value = 4.0;
oCube.Kinematics.Global.Parameters("posx").value = 2.0;
oCube.Kinematics.Global.Parameters("rotx").value = 45.0;
var oTrans = oCube.Kinematics.Local.Transform;
var aNormal = new VBArray( oCube.ActivePrimitive.Geometry.Facets.NormalArray );
var oOri = XSIMath.CreateVector3();
oOri.x = aNormal.getItem(0,1);
oOri.y = aNormal.getItem(1,1);
oOri.z = aNormal.getItem(2,1);
Application.LogMessage (aNormal.getItem(0,1));
Application.LogMessage (aNormal.getItem(1,1));
Application.LogMessage (aNormal.getItem(2,1));
var oObjectOri = XSIMath.MapObjectOrientationToWorldSpace(oTrans, oOri);
Application.LogMessage  ("The y unit vector  is represented by (" + 
                                XSIMath.RadiansToDegrees(oObjectOri.X) + "," + 
                                XSIMath.RadiansToDegrees(oObjectOri.Y) + "," + 
                                XSIMath.RadiansToDegrees(oObjectOri.Z) + ") in the cube object space");
// Expected results:
//INFO : The y unit vector  is represented by (0,-40.51423422706978,-40.51423422706977) 
//                      in the cube object space

2. VBScript Example

set oRoot = Application.ActiveProject.ActiveScene.Root
set oCube = oRoot.AddGeometry("Cube","MeshSurface")
oCube.Kinematics.Global.Parameters("posy").value = 4.0
oCube.Kinematics.Global.Parameters("posx").value = 2.0
oCube.Kinematics.Global.Parameters("rotx").value = 45.0
set oTrans = oCube.Kinematics.Local.Transform
set oOri = XSIMath.CreateVector3
aNormal = oCube.ActivePrimitive.Geometry.Facets.NormalArray
oOri.x = aNormal(0,2)
oOri.y = aNormal(1,2)
oOri.z = aNormal(2,2)
set oObjectOri = XSIMath.MapObjectOrientationToWorldSpace(oTrans, oOri)
Application.LogMessage  "The y unit vector  is represented by (" & _
                                XSIMath.RadiansToDegrees(oObjectOri.X) & "," & _
                                XSIMath.RadiansToDegrees(oObjectOri.Y) & "," & _
                                XSIMath.RadiansToDegrees(oObjectOri.Z) & ") in the cube object space"