gltf模型加载 与3d背景贴图

Poly Haveny

用于3d模型跟贴图下载资源

Sketchfab

里面有免费的模型

模型放到public里面

复制代码
const loader = new GLTFLoader()
      // 加载GLTF模型
      loader.load(
        '/scene.gltf',
        (gltf) => {
          // 将加载的模型添加到场景中
          scene.add(gltf.scene)
          // 现在你可以开始渲染循环了
          let angle = 0
          function animate() {
            requestAnimationFrame(animate)
            angle += 0.002
            gltf.scene.rotation.y = angle
            renderer.render(scene, camera)
          }
          animate()
        },
        // 可选:加载进度回调
        (xhr) => {
          console.log((xhr.loaded / xhr.total) * 100 + '% loaded')
        },
        // 可选:加载错误回调
        (error) => {
          console.log('An error happened', error)
        }
      )

就加载进来了

之后加载背景图。

点击右边的jpg,右键将图像另存为,放到public里面。

场景就添加进来了。

相关推荐
三维频道26 分钟前
压铸件尺寸检测与模具监测方案 / 3D Scanning for Die-casting QC & Mold Monitoring
人工智能·计算机视觉·3d·尺寸检测·xtom·压铸件·模具优化
aini_lovee28 分钟前
LIS3DH低功耗加速度传感器驱动程序
3d
三维频道30 分钟前
注塑件变形怎么调优?全尺寸3D检测如何助力精密注塑“减废增效”
3d·制造·智能制造·3d扫描仪·新拓三维·注塑模具质检·三维尺寸偏差分析
AI前沿资讯1 小时前
2026年3D动画制作工具推荐:从传统工作流到AI一站式创作
人工智能·3d
bryant_meng18 小时前
【3D】Stereo Matching learning notes
计算机视觉·3d·双目匹配
三维频道21 小时前
工业级三维扫描实测:汽车灯具复杂结构件的全尺寸 3D 测量方案分析
java·人工智能·python·数码相机·3d·汽车·汽车轻量化制造
MapVillage1 天前
3D Gaussian Splats 高斯泼溅技术
3d
杀生丸学AI1 天前
【三维重建】Neural Gabor Splatting:基于神经Gabor的增强型3DGS(高频表面重建)
3d·aigc·扩散模型·视觉大模型·点云分割·高斯泼溅·空间智能
魔士于安1 天前
Unity类似博物馆场景
前端·unity·游戏引擎·贴图·模型
a1117761 天前
Web3D 在线3D模型骨骼动画编辑器(开源 Reze Studio)
前端·3d·开源·html