Tamy is mostly correct, and that solution will work for many use cases, however, (and Dan can correct me if I’m wrong) I believe to guarantee the camera is exactly the same, you actually need to save off 6 properties. Here’s a small (untested) object that should do the tick.
var StoredView = function()
{
this.position = undefined;
this.direction = undefined;
this.up = undefined;
this.right = undefined;
this.transform = undefined;
this.frustum = undefined;
};
StoredView.prototype.save = function(camera)
{
if(typeof camera === ‘undefined’)
{
throw new DeveloperError(‘camera is required’);
}
this.position = camera.position.clone(this.position);
this.direction = camera.direction.clone(this.direction);
this.up = camera.up.clone(this.up);
this.right = camera.right.clone(this.right);
this.transform = camera.transform.clone(this.transform);
this.frustum = camera.frustum.clone(this.frustum);
};
StoredView.prototype.load = function(camera)
{
if(typeof this.position === ‘undefined’)
{
throw new DeveloperError(‘no view has been stored’);
}
this.position.clone(camera.position);
this.direction.clone(camera.direction);
this.up.clone(camera.up);
this.right.clone(camera.right);
this.transform.clone(camera.transform);
this.frustum.clone(camera.frustum);
};