With the old lookat you specified the eye ordinates directly using world ordinates. However you had to figure out how the eye ordinates relates to the target and Earth.
With the new lookat instead of setting the eye via world ordinates directly, you set an offset in terms of the ‘target’s Earth_ENU reference frame’. (eastNorthUp) You can set the offset directly in Cartesian form, or in Polar form and it will use function offsetFromHeadingPitchRange(heading, pitch, range) to convert to Cartesian form. You lose the ability set the camera roll, although you could still set the roll by following lookAt with a camera.look around the direction vector for the same affect.
The offset is in relation to the ‘target’s Earth ENU reference frame’ which doesn’t have any regard to a target’s orientation, only its position relative to Earth. So if the offset is set to the west of the target it will stay west of the target even as the target’s heading changes. Let’s say you want the offset to be in relation to the ‘target’s position/orientation reference frame’. In other words with a constant offset your view will always be looking at say the left wing of an aircraft even as the aircraft’s heading changes. This is how the camera functions in World of Warcraft, and I was planning on using this mode as well to aid in Streetview navigation.
Well Camera.prototype.lookAt does set eastNorthUpToFixedFrame (ENU) then calls the generic Camera.prototype.lookAtTransform = function(transform, offset)
Perhaps there can be 2 types of lookAts:
-The current one, which sets the target’s ENU frame as the reference frame (perhaps call it camera.lookAtTargetENU)
-And another one, which sets the target’s position/orientation as the reference frame. (perhaps call it camera.lookAtTarget)