threejs紋理更新錯誤
一個紋理的時候旋轉一次還行,用了兩個的時候得到的結果就不是你想象了。
這算是哪門子bug啊。
let map: any = new THREE.TextureLoader().load('map.png');
map.center = new THREE.Vector2(.5, .5);
map.rotation = Math.PI / 2;
map.matrixAutoUpdate = true;
const bumpmap: any = new THREE.TextureLoader().load('Bump.png');
bumpmap.center = new THREE.Vector2(.5, .5);
bumpmap.rotation = -Math.PI / 2;
bumpmap.matrixAutoUpdate = true;
const material = new THREE.MeshStandardMaterial({
color: new THREE.Color("rgb(41, 65, 105)"),
metalness: 0.5,
map: map,
bumpMap: bumpmap,
});