摘要:
环境光 const color = 0xFFFFFF; const intensity = 1; const light = new THREE.AmbientLight(color, intensity); scene.add(light); 创建地面 const planeSize = 40; 阅读全文
摘要:
创建纹理 // 导入纹理 const loader = new THREE.TextureLoader(); // 加载所需要的纹理图片 const texture1 = loader.load('./dist/texture/sea.jpg') const material5 = new THRE 阅读全文
摘要:
设置顶点创建矩形 const geometry3 = new THREE.BufferGeometry(); const vertices = new Float32Array([ -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, // 第二个三角形 1 阅读全文
摘要:
// 获取鼠标坐标 function onPointerMove(event) { //将鼠标点击位置的屏幕坐标转换成threejs中的标准坐标 mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = 1 - (event.cl 阅读全文
摘要:
导入轨道控制器包 import { OrbitControls } from "three/examples/jsm/controls/OrbitControls" BoxGeometry盒子+MeshBasicMaterial const geometry = new THREE.BoxGeome 阅读全文