MapObjectPositionT oWorldSpace (XSIMath)

Description

Converts a Position described in a given ObjectSpace to WorldSpace.

Scripting Syntax

    XSIMath.MapObjectPositionToWorldSpace( ObjectSpace, Position )

C# Syntax

    SIVector3 XSIMath.MapObjectPositionToWorldSpace( SITransformation in_pObjectSpace, SIVector3 in_pPosition );

Parameters

Parameter | Type | Description
ObjectSpace | SITransformation | ObjectSpace in which the position is described.
Position | SIVector3 | Position to convert.

Return Value

SIVector3 (position)

Examples

1. JScript Example

    NewScene (null, false);
    var oRoot = Application.ActiveProject.ActiveScene.Root;
    var oCube = oRoot.AddGeometry("Cube","MeshSurface");
    oCube.Kinematics.Global.Parameters("posy").value = 4.0;
    oCube.Kinematics.Global.Parameters("posx").value = 2.0;

    var oTrans = oCube.Kinematics.Local.Transform;
    var oPoint = oCube.ActivePrimitive.Geometry.Points(0);
    var oPos = oPoint.Position;
    Application.LogMessage ("The local position is: X "+ oPos.X + " Y " + oPos.Y + " Z " + oPos.Z);
    var oGlobalPos = XSIMath.MapObjectPositionToWorldSpace( oTrans, oPos);
    Application.LogMessage ("The world position is: X "+ oGlobalPos.X + " Y " + oGlobalPos.Y + " Z " + oGlobalPos.Z);

    // Expected results:
    //INFO : The local position is: X -4 Y -4 Z -4
    //INFO : The world position is: X -2 Y 0 Z -4

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

    set oTrans = oCube.Kinematics.Local.Transform
    set oPoint = oCube.ActivePrimitive.Geometry.Points(0)
    set oPos = oPoint.Position
    Application.LogMessage "The local position is: X "& oPos.X & " Y " & oPos.Y & " Z " & oPos.Z
    set oGlobalPos = XSIMath.MapObjectPositionToWorldSpace( oTrans, oPos)
    Application.LogMessage "The world position is: X "& oGlobalPos.X & " Y " & oGlobalPos.Y & " Z " & oGlobalPos.Z

    ' Expected results:
    'INFO : The local position is: X -4 Y -4 Z -4
    'INFO : The world position is: X -2 Y 0 Z -4

Autodesk Softimage v7.5