How do I call renderer.GetActiveCamera() in JavaScript using VTK/WASM?

renderer.GetActiveCamera().Zoom(0.5).

That will need the vtkCamera class and it’s member functions wrapped for javascript. Instead, we are thinking to enable function calls on object ids. So something like this might work in the future:

camera_id = rendererState.ActiveCamera.Id;
this.wasm.sceneManager.call(camera_id, "Zoom", 0.5);

What I don’t like about this is that code intellisense will not be able to tell you that there is a method called “Zoom” on the camera, and that it takes one floating point value.

fyi, @Sebastien_Jourdain

1 Like