Seeking assistance with moving the 3D camera in a linear motion. The current code I am using rotates the camera around the object, but I am looking to move the camera alongside the object instead.
Desired Outcome:
https://i.sstatic.net/RGMxP.png
Current Outcome:
https://i.sstatic.net/HGjVF.png
Code Snippet:
function MovePositionRight() {
var X, sCurrentX;
var sCurrentX = viewer.camera.position.z;
X = viewer.camera.position.z - 0.5;
MovePositionZ(viewer.camera.position.x, viewer.camera.position.y, X);
}
function MovePositionZ(X,Y,Z) {
//viewer.camera.position.set(0, 0, 15);
viewer.camera.position.set(X, Y, Z);
viewer.camera.updateProjectionMatrix();
viewer.render();
}