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里面。

场景就添加进来了。

相关推荐
学無芷境17 小时前
Simulation-Based Segmentation of Blood Vessels in Cerebral 3D OCTA Images
3d
乐园游梦记17 小时前
工业视觉(尤其是 3D/2.5D 相机场景)中针对不同数据类型、精度、用途设计的保存格式
数码相机·opencv·3d·c#
REDcker17 小时前
3DGS三维高斯泼溅Windows使用指南
3d·模型·三维重建·3dgs·三维模型·高斯泼溅
CG_MAGIC17 小时前
效果图渲染小诀窍
3d·效果图·建模教程·渲云
大鹅同志17 小时前
Ubuntu 20.04使用MB-System分析与可视化EM3000数据
数据库·3d·ros·slam·mb-system
CG_MAGIC1 天前
Blender制作水世界烟雾休息
blender·贴图·建模教程·渲云渲染
CG_MAGIC1 天前
效果图云渲染平台如何选择?
3d·3dmax·建模教程·渲云渲染·渲云
安生爱学习❤1 天前
(CVPR 2025) Birth and Death of a Rose 不靠 3D 数据,从 2D 扩散模型生成 4D 对象
3d
zstar-_2 天前
3DTiles的构建和加载方案
3d
memmolo2 天前
【3D传感技术系列博客】
算法·计算机视觉·3d