Hi,
I have a checkerboard starting from (0,0,0) and each checker piece is 100 x 100 on the X Y plane. In my init function I have:
camera = new THREE.PerspectiveCamera( 25, 1, 20, 4000 );
camera.position.set( 400, 400, 2200 );
camera.lookAt( 400, 400, 0 );
camera.up.set( 0, 0, 1 );
and it looks like this
The camera lookAt is set at the center of the checkerboard and this is exactly what I expect.
I have an external button that switches this top-down view to a 3d side view with these settings.
camera.position.set( 400, -1800, 800);
camera.lookAt( 400, 400, 0 );
camera.up.set( 0, 0, 1 );
camera.updateProjectionMatrix();
which results to this.
However, if I change the camera.lookAt(0,600,0) now it looks at the center.
And this is kind of a different issue I am having but when I click back to top-down view with the same init setting, the camera rotates at a 45-degree angle for some reason.
I tried using THREE.Vector3(400,400,0) instead of x,y,z coordinate but yields same result.
I think I am missing something in between but what I want to achieve is to have the camera look at the center of the checkerboard (400, 400, 0) where ever I move the camera.
any help will be appreciated
ps: not using any controls