小编jay*_*ibi的帖子

从 MeshBasicMaterial 切换到 MeshStandardMaterial 只会显示黑屏

三.js问题在这里。不知道为什么当我在第 10 行调用 MeshStandardMaterial 时我的代码不起作用。当我将其切换到 MeshBasicMaterial 时它可以工作,但我需要 MeshStandardMaterial 的功能才能将 .bumpMap 添加到渲染中。有人能帮忙吗?

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );

const renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

const geometry = new THREE.SphereGeometry(5,32,32);
// const texture = new THREE.TextureLoader().load( 'textures/8081_earthmap10k.jpg' );
const material = new THREE.MeshBasicMaterial( { color: 0xffffff } );




const cube = new THREE.Mesh( geometry, material );
scene.add( cube );

camera.position.z = 15;

const animate = …
Run Code Online (Sandbox Code Playgroud)

three.js

2
推荐指数
1
解决办法
3606
查看次数

标签 统计

three.js ×1