Panning the Camera
A xeometry viewer's camera can be panned on three axis:
- horizontally, along its local horizontal axis, which runs perpendicular to its eye->look and up vectors,
- vertically, along its up axis, and
- forwards and backwards, along its eye->look axis.
Panning translates eye and look in unison, and does not affect up.
Panning offsets are incremental, ie. relative to the camera's current position.
Examples
Setting an initial camera position:
viewer.setEye([0, 0, -100]);
viewer.setLook([0, 0, 0]);
viewer.setUp([0, 1, 0]);
Panning the camera five units to the left:
viewer.pan([-5, 0, 0]);
// eye is now [-5, 0, -100]
// look is now [-5, 0, 0]
// up remains [0, 1, 0]
Panning the camera three units upwards:
viewer.pan([0, 3, 0]);
// eye is now [-5, 3, -100]
// look is now [-5, 3, 0]
// up remains [0, 1, 0]
Panning the camera ten units backwards:
viewer.pan([0, 0, -10]);
// eye is now [-5, 3 -110]
// look is now [-5, 3, -10]
// up remains [0, 1, 0]