Camera.js 664 B

1234567891011121314151617181920212223242526272829
  1. THREE.Camera = function (x, y, z) {
  2. this.position = new THREE.Vector3(x, y, z);
  3. this.target = {
  4. position: new THREE.Vector3(0, 0, 0)
  5. }
  6. this.matrix = new THREE.Matrix4();
  7. this.projectionMatrix = THREE.Matrix4.makePerspective(45, 1 /*SCREEN_WIDTH/SCREEN_HEIGHT*/, 0.001, 1000);
  8. this.up = new THREE.Vector3(0, 1, 0);
  9. this.roll = 0;
  10. // TODO: Need to remove this
  11. this.zoom = 3;
  12. this.focus = 500;
  13. this.updateMatrix = function () {
  14. this.matrix.lookAt(this.position, this.target.position, this.up);
  15. }
  16. this.toString = function () {
  17. return 'THREE.Camera ( ' + this.position + ', ' + this.target.position + ' )';
  18. }
  19. this.updateMatrix();
  20. }
粤ICP备19079148号