Object Hierarchy | Related C++ Class: Kinematics
Kinematics
The Kinematics object represents the kinematics property of a X3DObject object
' ' This illustrates how to convert a position from local coordinates ' to global coordinates ' set oRoot = Application.ActiveProject.ActiveScene.Root if Selection.Count = 0 then ' create a sample scene set oModel = oRoot.AddModel oModel.posx.value = 5 set oObject = oModel.AddNull oObject.posx.value = 5 else set oObject = Selection(0) end if ' ' get local position ' Set v3Pos = XSIMath.CreateVector3 call v3Pos.Set( oObject.posx.value, oObject.posy.value, oObject.posz.value ) logmessage "local position = " & v3Pos.x & ", " & v3Pos.y & ", " & v3Pos.z ' ' transform local to global position ' Set v3GlobPos = XSIMath.MapObjectPositionToObjectSpace (oObject.Kinematics.Global.Transform, oObject.Kinematics.Local.Transform, v3Pos) logmessage "global position = " & v3GlobPos.x & ", " & v3GlobPos.y & ", " & v3GlobPos.z |