|
@@ -64,8 +64,6 @@
|
|
|
};
|
|
|
|
|
|
init();
|
|
|
- render();
|
|
|
-
|
|
|
|
|
|
function init() {
|
|
|
|
|
@@ -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 );
|
|
|
|