three.js - ThreeJS: the texture appears partially flat -
this test page http://www.aleaweb.com/3d/
as can see book has leather texture on spine , flat color on front , it's single object, know why texture applied incorrectly? has modeling or javascript programming?
this piece of code regarding book
var texture2 = three.imageutils.loadtexture( "textures/pelle.jpg"); texture2.wraps = three.clamptoedgewrapping; texture2.wrapt = three.clamptoedgewrapping; texture2.needsupdate = true; texture2.repeat.set( 1, 1 ); texture2.anisotropy = maxanisotropy; //var material = new three.meshphongmaterial({ color: 0xeeeeee, map:texture2, shininess: 100, bumpmap: texture2, bumpscale: 2, metal:false }); var materialarray = []; materialarray.push(new three.meshbasicmaterial( { color: 0xffffff })); materialarray.push(new three.meshphongmaterial( { map: textureb })); materialarray.push(new three.meshphongmaterial( { map: texture2, bumpmap:texture2 })); var dicebluematerial = new three.meshfacematerial(materialarray); var loader = new three.jsonloader(); loader.load( "js/libro2.js", function ( geometry, materials ) { createscene( geometry, materials, 0.2 ) }); // draw! function createscene( geometry, materials, scale ) { zmesh = new three.mesh( geometry, dicebluematerial ); zmesh.position.set( -50, -50, 100 ); //zmesh.rotation.set( 0, 0, 0 ); zmesh.rotation.set( 90 * math.pi / 180, 0, 30 * math.pi / 180 ); zmesh.scale.set( scale, scale, scale ); zmesh.castshadow = true; zmesh.receiveshadow = true; scene.add( zmesh ); scene.add( sphere ); animate(); //renderer.render(scene, camera); }
sorry if it's newbie question can't figure out!
Comments
Post a Comment