Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
WestLangley committed Oct 27, 2018
1 parent c0dbf05 commit 4a477b7
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions examples/webgl_materials_texture_rotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
};

init();
render();


function init() {

Expand All @@ -88,20 +86,25 @@

var geometry = new THREE.BoxBufferGeometry( 10, 10, 10 );

var loader = new THREE.TextureLoader();
var texture = loader.load( 'textures/UV_Grid_Sm.jpg', render );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
new THREE.TextureLoader().load( 'textures/UV_Grid_Sm.jpg', function ( texture ) {

texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();

//texture.matrixAutoUpdate = false; // default true; set to false to update texture.matrix manually

var material = new THREE.MeshBasicMaterial( { map: texture } );

texture.matrixAutoUpdate = false; // set this to false to update texture.matrix manually
mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );

var material = new THREE.MeshBasicMaterial( { map: texture } );
updateUvTransform();

mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
initGui();

updateUvTransform();
render();

initGui();
} );

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

Expand Down

0 comments on commit 4a477b7

Please sign in to comment.