Hello,
I’m uploading 3d Models and have an option to move the origin to a different location. (As in an example in SandCastle). After finish editing, I save all the parameters and destroy the transform editor.
How is it possible to re-create the Transform Editor with the same origin that was defined previously?
var transformEditor = new Cesium.TransformEditor( { container: viewer.container, scene: scene, transform: tileset_model.modelMatrix, boundingSphere: tileset_model.boundingSphere } );
transformEditor.viewModel.activate();
…
if (clickAction === ‘origin’)
transformEditor.viewModel.setOriginPosition(position);
…
transformEditor.destroy();
This is the way I load tileset model (all the parametrs were saved from Transorm Editor):
var modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(position);
var hprRotation = Cesium.Matrix3.fromHeadingPitchRoll(rotation);
var rotrans = Cesium.Matrix4.fromRotationTranslation(hprRotation,translation);
Cesium.Matrix4.multiply(modelMatrix, rotrans, modelMatrix);
Cesium.Matrix4.multiplyByScale(modelMatrix, scale, modelMatrix);
}
var tilesetOptions={
url: url,
modelMatrix: modelMatrix
};
var tileset=new Cesium.Cesium3DTileset(tilesetOptions);
Hope my question and explanation of the problem is clear.
Thank you