Replies: 1 comment 9 replies
-
Just put a click handler on your hotspot element that sets the |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to find a solution to change the orientation of the camera after click on button (hotspot). I'd like to implement a similar solution as tween.js for 3D models. This kind of usage is implemented by sketchfab for hotspots (the camera changes position and orienatation after clicking on the hotspot).
If I have several hotspots e.g.: <button class="Hotspot" slot="hotspot-1"...> can I use script below:
`<script>
function() {
const modelViewer = document.querySelector('#orbit-demo');
const orbitCycle = [
'45deg 55deg 4m',
modelViewer.cameraOrbit
];
setInterval(() => {
const currentOrbitIndex = orbitCycle.indexOf(modelViewer.cameraOrbit);
modelViewer.cameraOrbit =
orbitCycle[(currentOrbitIndex + 1) % orbitCycle.length];
}, 3000);
}
</script>`
to change camera orientation for these hotspots? How can I turn this script on after clicking on the specific hotspot (not automatically)?
Currently the script reverts to the default view after a given time. I need to change the camera orientation only when the hotspot is used.
Thank you all for any advice or support.
Beta Was this translation helpful? Give feedback.
All reactions