Added debug canvas and webgl render canvas, added viewcontroller

This commit is contained in:
logsol 2012-07-13 03:11:29 +02:00
parent 486cb4f312
commit dd71bf79a9
9 changed files with 224 additions and 109 deletions

View file

@ -1,30 +1,47 @@
define(['Vendor/Three', 'Chuck/Settings'], function(Three, Settings) {
function CameraController() {
/*
this.camera = new Three.OrthographicCamera(
-Settings.STAGE_WIDTH/2,
Settings.STAGE_WIDTH/2,
Settings.STAGE_HEIGHT/2,
-Settings.STAGE_HEIGHT/2,
-2000,
1000
);*/
function CameraController(isOrthographic) {
this.camera = new Three.OrthographicCamera( 600 / - 2, 600 / 2, 400 / 2, 400 / - 2, - 2000, 1000 );
isOrthographic = typeof isOrthographic == 'undefined'
? true
: isOrthographic;
//this.camera = new Three.PerspectiveCamera(45, 600 / 400, 1, 1000);
//this.camera.position.z = 481;
if(isOrthographic) {
this.camera = new Three.OrthographicCamera(
-Settings.STAGE_WIDTH/2,
Settings.STAGE_WIDTH/2,
Settings.STAGE_HEIGHT/2,
-Settings.STAGE_HEIGHT/2,
-2000,
1000
);
} else {
this.camera = new Three.PerspectiveCamera(
45,
Settings.STAGE_WIDTH / Settings.STAGE_HEIGHT,
-2000,
1000
);
}
this.camera.position.z = 481;
}
CameraController.prototype.getCamera = function(){
return this.camera;
}
CameraController.prototype.setPosition = function(x, y, z){
CameraController.prototype.setPosition = function(x, y){
this.camera.position.x = x;
this.camera.position.y = y;
}
CameraController.prototype.setZoom = function(z){
this.camera.position.z = z;
}