deltakosh 12 年之前
父節點
當前提交
c244f75ff9
共有 4 個文件被更改,包括 35 次插入10 次删除
  1. 18 2
      Babylon/Cameras/babylon.camera.js
  2. 1 1
      babylon.1.0.8.js
  3. 14 7
      readme.md
  4. 2 0
      what's new.txt

+ 18 - 2
Babylon/Cameras/babylon.camera.js

@@ -15,11 +15,21 @@
         }
     };
     
+    // Statics
+    BABYLON.Camera.PERSPECTIVE_CAMERA = 0;
+    BABYLON.Camera.ORTHOGRAPHIC_CAMERA = 1;
+    
     // Members
     BABYLON.Camera.prototype.fov = 0.8;
+    BABYLON.Camera.prototype.orthoLeft = null;
+    BABYLON.Camera.prototype.orthoRight = null;
+    BABYLON.Camera.prototype.orthoBottom = null;
+    BABYLON.Camera.prototype.orthoTop = null;
+    BABYLON.Camera.prototype.fov = 0.8;
     BABYLON.Camera.prototype.minZ = 0.1;
     BABYLON.Camera.prototype.maxZ = 1000.0;
     BABYLON.Camera.prototype.inertia = 0.9;
+    BABYLON.Camera.prototype.mode = BABYLON.Camera.PERSPECTIVE_CAMERA;
 
     // Methods
     BABYLON.Camera.prototype.attachControl = function (canvas) {
@@ -36,7 +46,13 @@
     };
 
     BABYLON.Camera.prototype.getProjectionMatrix = function () {
-        return new BABYLON.Matrix.PerspectiveFovLH(this.fov, this._scene.getEngine().getAspectRatio(), this.minZ, this.maxZ);
-    };
+        var engine = this._scene.getEngine();
+        if (this.mode === BABYLON.Camera.PERSPECTIVE_CAMERA) {
+            return new BABYLON.Matrix.PerspectiveFovLH(this.fov, engine.getAspectRatio(), this.minZ, this.maxZ);
+        }
 
+        var halfWidth = engine.getRenderWidth() / 2.0;
+        var halfHeight = engine.getRenderHeight() / 2.0;
+        return new BABYLON.Matrix.OrthoOffCenterLH(this.orthoLeft || -halfWidth, this.orthoRight || halfWidth, this.orthoBottom || -halfHeight, this.orthoTop || halfHeight, this.minZ, this.maxZ)
+    };
 })();

文件差異過大導致無法顯示
+ 1 - 1
babylon.1.0.8.js


+ 14 - 7
readme.md

@@ -10,10 +10,12 @@ Official web site: [www.babylonjs.com](http://www.babylonjs.com/)
 - Animations engine
 - Particles Systems
 - Sprites and 2D layers
--  Optimizations engines:  - Frustum clipping
+-  Optimizations engines: 
+ - Frustum clipping
  - Sub-meshes clipping
  - Hardware scaling
-- Standard material is a per pixel material that supports:  - Diffuse lightning and texture
+- Standard material is a per pixel material that supports:
+ - Diffuse lightning and texture
  - Ambient lightning and texture
  - Specular lightning
  - Opacity texture
@@ -25,21 +27,26 @@ Official web site: [www.babylonjs.com](http://www.babylonjs.com/)
  - Up to 4 lights (points, directionals, spots, hemispherics)
  - Custom materials
  - Skybox
--  Special FX  - Fog
+-  Special FX
+ - Fog
  - Alpha blending
  - Alpha testing
  - Billboarding
  - Fullscreen mode
--  Textures:  - Render target textures
+-  Textures:
+ - Render target textures
  - Dynamic textures (canvas)
  - Video textures
--  Cameras:  - Arc rotate camera
+-  Cameras (Perspective and orthographic):
+ - Arc rotate camera
  - Free camera
  - Touch camera
--  Meshes:  - Mesh cloning
+-  Meshes: 
+ - Mesh cloning
  - Dynamic meshes
  - Height maps
--  Import:  - Babylon scene file can be converted from .OBJ, .FBX, .MXB
+-  Import: 
+ - Babylon scene file can be converted from .OBJ, .FBX, .MXB
  - Exporter for Blender
 
 

+ 2 - 0
what's new.txt

@@ -1,3 +1,5 @@
+1.0.9:
+ - Orthographic camera
 1.0.8:
  - Adding keyboard support to ArcRotateCamera
  - Starting to use git tag