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

场景就添加进来了。

相关推荐
AI浩18 小时前
LabelAny3D: Label Any Object 3D in the Wild
3d
学無芷境20 小时前
vesselFM: A Foundation Model for Universal 3D Blood Vessel Segmentation
3d
CG_MAGIC1 天前
云渲染时能否关机或断网?
3d·云渲染·建模教程·渲云渲染·3d软件
拾荒的小海螺1 天前
开源项目:Three.js 构建 3D 世界的工具库
javascript·3d·开源
gihigo19982 天前
使用MATLAB绘制3D心形图和玫瑰花图案
开发语言·matlab·3d
zl_vslam2 天前
SLAM中的非线性优-3D图优化之地平面约束(十五)
人工智能·算法·计算机视觉·3d
STCNXPARM2 天前
Android14显示系统 - 开源图形库Mesa3d
3d·开源·mesa3d·android图形库·opengl-es
杀生丸学AI2 天前
【平面重建】3D高斯平面:混合2D/3D光场重建(NeurIPS2025)
人工智能·平面·3d·大模型·aigc·高斯泼溅·空间智能
threelab2 天前
Merge3D 三维引擎中 GeoJSON 数据加载的整体设计
android·3d
徐112 天前
无图纸定制修复汽车外饰?3DeVOK MT+QUICKSURFACE逆向设计解决方案
3d·汽车·机器翻译