javascript - Three.js canvas : Unload/load texture next panorama image -


what best practice display next panorama ? (change images) ?

event click button ->

var materials = [                  loadtexture( 'pano_next0001.jpg' ), // right                 loadtexture( 'pano_next0003.jpg' ), // left                 loadtexture( 'pano_next0004.jpg' ), // top                 loadtexture( 'pano_next0005.jpg' ), // bottom                 loadtexture( 'pano_next0000.jpg' ), //                 loadtexture( 'pano_next0002.jpg' )  // front              ]; scene.remove(scene.children[0]); mesh = new three.mesh( new three.boxgeometry( 300, 300, 300, 7, 7, 7 ), new three.meshfacematerial( materials )); mesh.scale.x = - 1; scene.add( mesh ); 

well,t think change box geometry's material.like :

var z=new three.meshbasicmaterial( { map: three.imageutils.loadtexture('...jpg',three.uvmaping,function(){             mesh.material.materials[i]=z;         }) 

the i index of 6 materials.have loop 6 faces's material.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -