Modifying Kitware/visualizer but resetCamera is not working...

Hello! I’m working on making single rendering view with paraview backend.

I successed with running python launcher included in Kitware/visualizer.

I changed the renderer of visualizer from React/Renderers/VtkRenderer to NativeUI/Canvas/RemoteRenderer due to more flexible compability.
I can call the methods in renderer object such as getCamera.
However, it seems that resetCamera and updateCamera are not working.
I can manipulate the camera with mouse interaction (drag).

I cannot find the reason why its not working because getCamera is called exactly the same way that I did with resetCamera and updateCamera.
Could you help me with this? :frowning:

Below is my code for resetting camera.
window.renderer is an object of NativeUI/Canvas/RemoteRenderer class and is set before it is called.

resetCamera() {
  console.log(window.renderer);

  console.log(parseInt(window.renderer.view));
  console.log(network.getClient().ViewPort.getCamera(parseInt(window.renderer.view)));
  console.log(network.getClient().ViewPort.resetCamera(parseInt(window.renderer.view)));

  window.renderer.render();
}

Do you get an error in the console? Can you elaborate on not working? Do you get a response, an error, something else?

Also in term of rendering, we now use the RemoteView of vtk.js that is use in that project as an example which is similar to NativeUI/Canvas/RemoteRenderer but more modern.

1 Like

Returned value from getCamera is a fulfilled Promise object with camera information such as focal, position, and up vectors. I also checked whether this camera information changes when I manipulate view with mouse and it worked well.

However, returned value from resetCamera is a fulfilled Promise object with value “317”, which is the id number of my view. I think the communication through the websocket works fine but resetCamera doesn’t reset the camera of the view and the view remains the same as before. Do I need to call another method in JS code to apply the change of the camera view in paraview server?

I’m currently working on code that is already implemented with older version of paraviewweb so I think changing the renderer would take so much time :frowning:

Based on what you are saying everything seems to be working as expected.

Is the view not refreshing? Or the center of rotation is not what you expect? What is the part of the reset camera that does not work?

1 Like

I think I might be misunderstanding something here…

Doesn’t resetCaemra change the angle of view?
I expected that resetCamera rotate the camera to the default orientation which is set when the connection established.


This is the camera position when the connection is established and I want to reset the camera like this.


After manipulating the camera like above and call the resetCamera, camera doesn’t change and remains the same like the above.

The behavior that you are seeing is expected and meant to be like it is.

ResetCamera aims to ensure the object best fit in the viewport while keeping its current orientation.

To see the reset camera change the view, you will have to pan or zoom.

1 Like

I misunderstood the function.

Is there any documentation about available actions for Kitware/visualizer client or paraviewweb?
I look through visualizer website documentation and paraviewweb documentation but still couldn’t find it.

Thanks for your kind replies! It surely helped me a lot :slight_smile:

You should look at ParaView and its tutorial. Visualizer is just a front-end to ParaView that is web based.

1 Like