function init() {
  // this function is executed on each animation frame
  function animate() {
    render();

    // request new frame
    requestAnimationFrame(function() {
      animate();
    });
  }

  // renderer
  threeD = document.getElementById('r3d');
  renderer = new THREE.WebGLRenderer({
    antialias: true,
    alpha: true,
  });
  renderer.setSize(threeD.clientWidth, threeD.clientHeight);
  renderer.setClearColor(0x3f51b5, 1);

  threeD.appendChild(renderer.domElement);

  // stats
  statsyay = new Stats();
  threeD.appendChild(statsyay.domElement);

  // scene
  sceneLayer0 = new THREE.Scene();
  sceneLayer1 = new THREE.Scene();
  sceneLayerMix = new THREE.Scene();

  // render to texture!!!!
  sceneLayer0TextureTarget = new THREE.WebGLRenderTarget(threeD.clientWidth, threeD.clientHeight, {
    minFilter: THREE.LinearFilter,
    magFilter: THREE.NearestFilter,
    format: THREE.RGBAFormat,
  });

  sceneLayer1TextureTarget = new THREE.WebGLRenderTarget(threeD.clientWidth, threeD.clientHeight, {
    minFilter: THREE.LinearFilter,
    magFilter: THREE.NearestFilter,
    format: THREE.RGBAFormat,
  });

  // camera
  camera = new CamerasOrthographic(
    threeD.clientWidth / -2,
    threeD.clientWidth / 2,
    threeD.clientHeight / 2,
    threeD.clientHeight / -2,
    0.1,
    10000
  );

  // controls
  controls = new ControlsOrthographic(camera, threeD);
  controls.staticMoving = true;
  controls.noRotate = true;
  camera.controls = controls;

  animate();
}
function init() {
  
  function animate() {
    render();

    
    requestAnimationFrame(function() {
      animate();
    });
  }

  
  threeD = document.getElementById('r3d');
  renderer = new THREE.WebGLRenderer({
    antialias: true,
    alpha: true,
  });
  renderer.setSize(threeD.clientWidth, threeD.clientHeight);
  renderer.setClearColor(0x3f51b5, 1);

  threeD.appendChild(renderer.domElement);

  
  statsyay = new Stats();
  threeD.appendChild(statsyay.domElement);

  
  sceneLayer0 = new THREE.Scene();
  sceneLayer1 = new THREE.Scene();
  sceneLayerMix = new THREE.Scene();

  
  sceneLayer0TextureTarget = new THREE.WebGLRenderTarget(threeD.clientWidth, threeD.clientHeight, {
    minFilter: THREE.LinearFilter,
    magFilter: THREE.NearestFilter,
    format: THREE.RGBAFormat,
  });

  sceneLayer1TextureTarget = new THREE.WebGLRenderTarget(threeD.clientWidth, threeD.clientHeight, {
    minFilter: THREE.LinearFilter,
    magFilter: THREE.NearestFilter,
    format: THREE.RGBAFormat,
  });

  
  camera = new CamerasOrthographic(
    threeD.clientWidth / -2,
    threeD.clientWidth / 2,
    threeD.clientHeight / 2,
    threeD.clientHeight / -2,
    0.1,
    10000
  );

  
  controls = new ControlsOrthographic(camera, threeD);
  controls.staticMoving = true;
  controls.noRotate = true;
  camera.controls = controls;

  animate();
}
function init ( ) { // this function is executed on each animation frame function animate ( ) { render ( ) ; // request new frame requestAnimationFrame ( function ( ) { animate ( ) ; } ) ; } // renderer threeD = document . getElementById ( 'r3d' ) ; renderer = new THREE . WebGLRenderer ( { antialias : true , alpha : true , } ) ; renderer . setSize ( threeD . clientWidth , threeD . clientHeight ) ; renderer . setClearColor ( 0x3f51b5 , 1 ) ; threeD . appendChild ( renderer . domElement ) ; // stats statsyay = new Stats ( ) ; threeD . appendChild ( statsyay . domElement ) ; // scene sceneLayer0 = new THREE . Scene ( ) ; sceneLayer1 = new THREE . Scene ( ) ; sceneLayerMix = new THREE . Scene ( ) ; // render to texture!!!! sceneLayer0TextureTarget = new THREE . WebGLRenderTarget ( threeD . clientWidth , threeD . clientHeight , { minFilter : THREE . LinearFilter , magFilter : THREE . NearestFilter , format : THREE . RGBAFormat , } ) ; sceneLayer1TextureTarget = new THREE . WebGLRenderTarget ( threeD . clientWidth , threeD . clientHeight , { minFilter : THREE . LinearFilter , magFilter : THREE . NearestFilter , format : THREE . RGBAFormat , } ) ; // camera camera = new CamerasOrthographic ( threeD . clientWidth / - 2 , threeD . clientWidth / 2 , threeD . clientHeight / 2 , threeD . clientHeight / - 2 , 0.1 , 10000 ) ; // controls controls = new ControlsOrthographic ( camera , threeD ) ; controls . staticMoving = true ; controls . noRotate = true ; camera . controls = controls ; animate ( ) ; }
FUNCTIONS
FUNCTIONS