This function moves the camera to a given position.
Parameter
action: “moveCamera”
position: object – position to move the camera to (with x, y and z value)
duration: number – duration (in ms) of the camera movement
Example
<div class="augmenteers-embed-wrapper">
<iframe id="augmenteersIframe"
src="https://viewer.augmenteers.com/embedded-model/b5ee0af5ec2cd3a3d19a373d03b19d0a?autostart=true&controls=false&btn_start=false&viewer_api=true"
frameborder="0" allow="fullscreen" mozallowfullscreen="true" webkitallowfullscreen="true">
</iframe>
</div>
<script type="text/javascript">
const iframe = document.getElementById("augmenteersIframe").contentWindow;
function moveCamera1() {
iframe.postMessage({action: "moveCamera, position: {x: 2, y: 2, z: 2}, duration: 1000}"}, "*");
}
function moveCamera2() {
iframe.postMessage({action: "moveCamera, position: {x: 2, y: 4, z: 6}, duration: 1000}"}, "*");
}
</script>
<button onclick="moveCamera1()">
Move to position 1
</button>
<button onclick="moveCamera2()">
Move to position 2
</button>