Provides the Camera object with information about the camera position, target position and projection matrix information.
You can access most of the constructor properties from a camera instance:
The Camera object, used as eye to project the scene into.
var camera = new PhiloGL.Camera(fov, aspect, near, far [, options]);
Creates a camera with position (0, 0, 10) pointing to a target in (0, 0, 0).
var canvas = document.getElementById('canvas');
var camera = new PhiloGL.Camera(45, canvas.width / canvas.height, 0.1, 100, {
position: {
x: 0, y: 0, z: 10
}
});
Updates the Camera view matrix with the information provided on position and target respectively.
camera.update();
var camera = new PhiloGL.Camera(45, canvas.width / canvas.height, 0.1, 100, {
position: {
x: 0, y: 0, z: 10
}
});
camera.position = {
x: 10,
y: 0,
z: 10
};
camera.update(); //update matrices