Skip to content

Commit

Permalink
Examples: Clean up. (mrdoob#26962)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Oct 14, 2023
1 parent c93a459 commit 30b6736
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions examples/webgl_loader_gltf.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
let camera, scene, renderer;

init();
render();

function init() {

Expand Down Expand Up @@ -63,12 +62,12 @@
const loader = new GLTFLoader().setPath( 'models/gltf/DamagedHelmet/glTF/' );
loader.load( 'DamagedHelmet.gltf', async function ( gltf ) {

await renderer.compileAsync( gltf.scene, camera );

scene.add( gltf.scene );

render();
await renderer.compileAsync( scene, camera );

render();

} );

} );
Expand Down
4 changes: 1 addition & 3 deletions examples/webgl_loader_gltf_transmission.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@
new GLTFLoader()
.setPath( 'models/gltf/' )
.setDRACOLoader( new DRACOLoader().setDecoderPath( 'jsm/libs/draco/gltf/' ) )
.load( 'IridescentDishWithOlives.glb', async function ( gltf ) {
.load( 'IridescentDishWithOlives.glb', function ( gltf ) {

mixer = new THREE.AnimationMixer( gltf.scene );
mixer.clipAction( gltf.animations[ 0 ] ).play();

await renderer.compileAsync( gltf.scene, camera );

scene.add( gltf.scene );

} );
Expand Down

0 comments on commit 30b6736

Please sign in to comment.