Back to Demos

This demo shows how you can move nodes on given plane.

Clara.io demo resources:

Visit Base Scene


var sceneId = '6aa34336-5915-43f9-a153-6cd78dc3c986';
var api = claraplayer('player');

api.player.showTool('nodeMove');
api.player.removeTool('select');
var hl = api.selection.setHighlighting(true);

api.sceneIO.fetchAndUse(sceneId).then(function() {
  var opts = {
    displayGizmo: false,
    mode: 'plane',
    plane: { normal: { x: 0, y: 1, z: 0 }, constant: 0 },
  };
  api.commands.setCommandOptions('nodeMove', opts);

  var objectId = api.scene.find({ type: 'PolyMesh', name: 'Sphere' });
  hl.selectionSet.add(objectId);
  api.selection.selectNode(objectId);

  api.commands.activateCommand('nodeMove');

  document
    .getElementById('baseScene')
    .setAttribute('href', 'https://clara.io/view/' + sceneId);
});