SynchronizedCamera (With Projection Matrix)

by Julien Gobin

HTML

<script src="https://rawgithub.com/BabylonJS/Babylon.js/master/babylon.1.8.0.js"></script>
<button id="bug">Show me bug</button>

<div id="rootDiv">
  <canvas id="renderCanvas"></canvas>
</div>

CSS

html, body, div, canvas {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

JavaScript

// Scene //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    BABYLON.Scene = function (engine) {
        this._engine = engine;
        this.autoClear = true;
        this.clearColor = new BABYLON.Color3(0.2, 0.2, 0.3);
        this.ambientColor = new BABYLON.Color3(0, 0, 0);

        engine.scenes.push(this);

        this._totalVertices = 0;
        this._activeVertices = 0;
        this._activeParticles = 0;
        this._lastFrameDuration = 0;
        this._evaluateActiveMeshesDuration = 0;
        this._renderTargetsDuration = 0;
        this._renderDuration = 0;

        this._renderId = 0;
        this._executeWhenReadyTimeoutId = -1;

        this._toBeDisposed = new BABYLON.Tools.SmartArray(256);

        this._onReadyCallbacks = [];
        this._pendingData = [];

        this._onBeforeRenderCallbacks = [];

        // Fog
        this.fogMode = BABYLON.Scene.FOGMODE_NONE;
        this.fogColor = new BABYLON.Color3(0.2, 0.2, 0.3);
        this.fogDensity = 0.1;
        this.fogStart = 0;
        this.fogEnd = 1000.0;

        // Lights
        this.lightsEnabled = true;
        this.lights = [];

        // Cameras
        this.cameras = [];
        this.activeCamera = null;

        // Meshes
        this.meshes = [];

        // Internal smart arrays
        this._activeMeshes = new BABYLON.Tools.SmartArray(256);
        this._processedMaterials = new BABYLON.Tools.SmartArray(256);
        this._renderTargets = new BABYLON.Tools.SmartArray(256);
        this._activeParticleSystems = new BABYLON.Tools.SmartArray(256);
        this._activeSkeletons = new BABYLON.Tools.SmartArray(32);

        // Rendering groups
        this._renderingManager = new BABYLON.RenderingManager(this);

        // Materials
        this.materials = [];
        this.multiMaterials = [];
        this.defaultMaterial = new BABYLON.StandardMaterial("default material", this);

        // Textures
       ...