/*
This example illustrates how to get/set the local translation using two
different approaches
*/
NewScene( null, false );
var oNull1 = Application.ActiveSceneRoot.AddNull();
oNull1.posx.Value = 45;
var oNull2 = Application.ActiveSceneRoot.AddNull();
oNull2.posx.Value = 19;
// ACCESSING
// Access the local translation using the KinematicState
var oTransform = oNull1.Kinematics.Local.Transform;
var oTranslation = oTransform.Translation;
// Access the local translation using X3DObject.LocalTranslation
var oTranslation2 = oNull2.LocalTranslation;
Application.LogMessage( "Null1 pos x - " + oTranslation.X );
Application.LogMessage( "Null2 pos x - " + oTranslation2.X );
// SETTING
// Set the translation using the KinematicState
oTransform.SetTranslationFromValues( 2.0, 1.0, 0.0 );
oNull1.Kinematics.Local.Transform = oTransform;
// Set the translation using X3DObject.LocalTranslation
oTranslation2.Set( 2.0, 1.0, 0.0 );
oNull2.LocalTranslation = oTranslation2;
// Expected results:
//INFO : Null1 pos x - 45
//INFO : Null2 pos x - 19 |