Skip to content

Commit

Permalink
Examples: Clean up webgl_loader_gltf_extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 10, 2020
1 parent cd74133 commit 3e56941
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions examples/webgl_loader_gltf_extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
<div id="description"></div>
</div>

<div id="container"></div>

<script type="module">

import * as THREE from '../build/three.module.js';
Expand All @@ -28,7 +26,7 @@
import { RGBELoader } from './jsm/loaders/RGBELoader.js';

var orbitControls;
var container, camera, scene, renderer, loader;
var camera, scene, renderer, loader;
var gltf, background, envMap, mixer, gui, extensionControls;

var clock = new THREE.Clock();
Expand Down Expand Up @@ -147,14 +145,12 @@

function onload() {

container = document.getElementById( 'container' );

renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputEncoding = THREE.sRGBEncoding;
renderer.physicallyCorrectLights = true;
container.appendChild( renderer.domElement );
document.body.appendChild( renderer.domElement );

window.addEventListener( 'resize', onWindowResize, false );

Expand Down Expand Up @@ -196,7 +192,7 @@
scene = new THREE.Scene();
scene.background = new THREE.Color( 0x222222 );

camera = new THREE.PerspectiveCamera( 45, container.offsetWidth / container.offsetHeight, 0.001, 1000 );
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.001, 1000 );
scene.add( camera );

var spot1;
Expand Down Expand Up @@ -388,7 +384,7 @@

function onWindowResize() {

camera.aspect = container.offsetWidth / container.offsetHeight;
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();

renderer.setSize( window.innerWidth, window.innerHeight );
Expand Down

0 comments on commit 3e56941

Please sign in to comment.