未验证 提交 876bcfa9 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #15146 from WestLangley/dev-texture_rotation_example

Texture rotation example: clean up
......@@ -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 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册