I have set up a simple working example using react next js that creates a session, a viewport and it lets me change a parameter using the range slider:
I think I may be doing something wrong with react js. Would anyone please be able to create a react js example of this and share it? I think if I have one example with interactions then I’ll be able to do animations. Would be quite helpful
Several users are using our viewer with React JS, i.e. I don’t expect a general problem, but we are currently working on some components that you will be able to reuse and should make your life easier. We will include interaction setup.
Maybe there is a problem with the layout of the page, such that the events don’t arrive where they should.
@snabela thank you for the example. It’s now becoming clearer. It’s more complex than I thought but I managed to get the interactions working. I think it would be helpful to play around with it more so I can understand the underlying code more. The next thing I’d like to test is the animations.
I tried adding animations based on your example and implementing this.
Created SdSessionAnimationData.tsx in the scr/components folder:
Animation works, but only if I click on the object. Which suggests that it’s being initiated by the selectManager. In this example, the animation is being initiated on page load without having to click anywhere. Any idea how can I control the animation start and stop?