Strange behaviour while changing camera settings of a scene

Hello all,

I have a scene that is composed of two actors, one made out of a sphere and another is a point cloud with a sphere mapper.

After some user interactions (changes in the camera), I’m trying to come back to the initial view, called “home view”.

The code below works for almost all scenarios, but there is a strange behaviour when I zoom out a lot from the initial camera view. After calling the toView function, my actors seems to vanish and all I see is my background color. But a single mousewheel shows me that I came back at the home view as I hoped and the scene pops up nicely. But why ? and how could I avoid this ?

I tryied to play with lots of the camera settings, but I think I’m missing something here. As I’m stuck for several days, I’m calling for help.

Thanks in advance for your ideas.

function toView(vector) {
const camera = renderer.getActiveCamera();
camera.setFocalPoint(vector[0],vector[1],vector[2]);
camera.setPosition(vector[3],vector[4],vector[5]);
camera.setViewUp(vector[6], vector[7],vector[8]);
camera.computeDistance();
renderWindow.render();
}

const homeCameraVector = [0.,0.,0.,0.,0.,15,0.,1.,0.];
toView(homeCameraVector);

You may need to update the camera clipping range.

1 Like

Thanks, it solved it. I thought I had checked, but it seems not.

Anyway, thanks for the answer !

1 Like