XSIMath.MapObjectPositionToWorldSpace

説明

指定されたObjectSpace で記述された位置を、WorldSpace に変換します。

スクリプト 構文

oReturn = XSIMath.MapObjectPositionToWorldSpace( ObjectSpace, Position );

戻り値

SIVector3(位置)

パラメータ

パラメータ タイプ 詳細
ObjectSpace SITransformation 位置が記述されているObjectSpace
位置 SIVector3 変換する位置

1. JScript の例

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 の例

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