model-viewer

playcanvasMIT活跃维护

基于 PlayCanvas 的网页端 3D 模型查看器,支持加载 glTF 模型和 3D Gaussian Splatting 场景,方便在浏览器里直接预览和调试三维资产。

3D Model Viewer supporting glTF and 3D Gaussian Splats

v5.10.0发布于 2026-06-16 10:36 UTC715star +1 / 7 天120fork同步于 2026-11-10 11:56 UTC

怎么上手

由 README 提炼,执行前请确认
npm install
npm run build
npm run serve
硬件要求按 README 说明

README 未说明硬件要求;浏览器端运行,需支持 WebGL 的现代浏览器

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

PlayCanvas 出品的 glTF 场景查看器,兼容 glTF 2.0 规范,可快速预览模型

基于 PlayCanvas 的网页端 3D 模型查看器,支持加载 glTF 模型和 3D Gaussian Splatting 场景,方便在浏览器里直接预览和调试三维资产。

核心能力

  • 完整支持 glTF 2.0 规范,可加载任意 glTF 场景
  • 支持拖拽 GLB 或 glTF 文件夹直接预览
  • 支持拖入 HDR、PNG、JPG 图片设置环境背景
  • 支持 URL 参数指定模型地址与初始相机位置
  • 基于 PlayCanvas Engine 渲染,构建产物输出到 dist

容易踩的坑

需要 Node.js v22.22 及以上版本;本地加载模型需在模型目录运行 npx server --cors 关闭 CORS;开发服务默认端口为 3000

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v5.10.0
  1. v5.10.0最新正式版2026-06-16 · 2026-06-16 10:36 UTC

    What's Changed

    Full Changelog: https://github.com/playcanvas/model-viewer/compare/v5.9.0...v5.10.0

  2. v5.9.02026-02-16 · 2026-02-16 10:31 UTC

    这个版本没有写更新说明。

  3. v5.8.12026-01-21 · 2026-01-21 07:59 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/playcanvas/model-viewer/compare/v5.8.0...v5.8.1

  4. v5.8.02025-12-29 · 2025-12-29 15:54 UTC
    查看更新说明

    What's Changed

    Fixes

    Full Changelog: https://github.com/playcanvas/model-viewer/compare/v5.7.0...v5.8.0

  5. v5.7.02025-11-18 · 2025-11-18 11:38 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/playcanvas/model-viewer/compare/v5.6.3...v5.7.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    PlayCanvas Model Viewer

    Github Release License Discord Reddit X

    | User Manual | API Reference | Blog | Forum |

    The PlayCanvas glTF scene viewer is blazingly fast and 100% compliant with the glTF 2.0 spec.

    PlayCanvas Viewer

    You can find a live version at:

    https://playcanvas.com/model-viewer

    Viewing Scenes

    The viewer can load any glTF 2.0 scene. Embedded glTF and binary glTF (GLB) can be dragged directly into the 3D view. To load an unpacked glTF scene, drag its parent folder into the 3D view.

    You can also drag and drop images into the 3D view to set a background. Options are:

    • Single file images are treated as equirectangular projections. Supported formats are PNG, JPG and HDR. Find high quality HDR images at HDRHaven.
    • Six images are treated as cube map faces. Naming should be one of the following 5 forms, where each face name below should be incorporated in the overall filename like name_posx.png for example:
    Face 0Face 1Face 2Face 3Face 4Face 5
    posxnegxposynegyposznegz
    pxnxpynypznz
    rightleftupdownfrontback
    rightlefttopbottomforwardbackward
    012345

    Supported URL Parameters

    Some URL query parameters are available to override certain aspects of the viewer:

    ParameterDescriptionExample
    load/assetUrlSpecify URL to a glTF scene to load?load=URL
    cameraPositionOverride the initial camera position?cameraPosition=0,0,20

    How to build

    Ensure you have Node.js installed (v22.22+). Then, from a command prompt, run:

    npm install
    npm run build
    

    This will invoke Vite and esbuild and output the built viewer to the dist folder. To rebuild the viewer on saving any source file, do:

    npm run watch
    

    How to run

    Run:

    npm run serve
    

    Open a browser and navigate to http://localhost:3000.

    Development

    Run:

    npm run develop
    

    Open a browser and navigate to http://localhost:3000.

    N.B. To load local models run npx server --cors in the directory containing the model (disables CORS).

    Library integration testing

    The Model Viewer is built on the following open source libraries:

    LibraryDetails
    PlayCanvas EnginePowers the Editor's 3D View and Launch Page
    ObserverData binding and history
    PCUIFront-end component library

    To test the integration of these libraries use npm link. Follow these steps:

    1. Create a global link from source

      cd <library>
      npm link
      
    2. Create a link to the global link

      cd model-viewer
      npm link <library>