Help! how to add animation to a specific slot?

Hi here,
I’m working on an app and what ever I do I am not able to translate the code in the experiments to something workable for the app. Mainly about animation. I want to start an animation with a click on a tab and stop when I leave that specific part of the sidebar.
Here is the application, I’m still filling in the text and adjusting the css so don’t mind that but I really want this animation to work. the tab is data-rel=“AtlasAxis” and there is only one animation. How can I get this to work?

And while I’m add it: if I can add textures to a specific object in a specific click that would be awesome too!

P.S. I am already searching for this for years now, I know, I should have come sooner…
P.P.S. it’s a heavy model, it does work on my ipad, so it should be viewable.

Hi Mieke,
here are two examples:

Starting and stopping animations

Swapping textures, both with a texture currently in the scene and a newly uploaded one.

1 Like

ok. I think I can work with that. going to try it. (first animation, that’s the most important one for now) thanks.

Hi Klaas,

My problem is that I have several id’s and I want to play the animation directly when clicking on the specific tab. So several behaviors in one: goto.annotation, hide object and start animation. How can I incorporate that in one instance of a function?

It’s no problem to perform multiple actions with one click of a tab. You just need to take care that some actions should be stringed together with callbacks or promises. Assuming you have an event set up when you click on the tab you could do something like this (pseudocode)

var tabclick = function() {
  gotoAnnotation(annotation_id)
  setObjectVisibility(instance_id, true)
  startAnimation(animation_id)
}
2 Likes