• 正文概述
  • GitHub – KhronosGroup/glTF-Sample-Viewer:使用 WebGL 在 glTF 2.0 中进行基于物理的渲染

    Name
    3 weeks ago
    4 years ago
    8 months ago
    3 weeks ago
    3 weeks ago
    5 years ago
    last year
    last year
    7 years ago
    6 years ago
    last year
    3 weeks ago
    3 years ago
    last year
    3 months ago
    last year
    3 months ago
    3 months ago
    3 months ago

    glTF 示例查看器 Web 应用程序

    图像描述

    这是使用 WebGL 2.0 的官方 Khronos glTF 2.0 示例查看器:

    观众

    链接到实时 glTF 2.0 示例查看器

    特征

    GLTF的

    用户界面

    • 直接通过UI选择所有glTF-Sample-Assets
    • 通过拖放加载您自己的 glTF/glb 和 HDR 文件
    • 自定义照明和色调映射
    • 使用集成的 glTF-Validator 检查验证错误
    • 选择不同的材料变体
    • 启用/禁用特定动画
    • 启用/禁用 glTF 功能/扩展并查看调试通道
    • 下载渲染图和当前相机属性
    • 显示有关当前加载文件的统计信息
    • 指定 URL 参数以修改加载时的行为

    用法

    控制

    click + drag:旋转模型

    shift + drag
    middle mouse button + drag:平移相机

    scroll
    right click + drag:变焦相机

    GUI:用于更改型号和设置

    更改 glTF 模型

    • 在选择列表中选择一个 glTF 模型
    • 将 glTF 文件拖放到查看器中

    更改环境映射

    • 拖放 .hdr 全景图文件

    URL 参数

    URL 参数添加到示例查看器 URL 的末尾:
    ?key=value&another_key=another_value

    可能的参数:

    • model=URL_to_file:从指定的URL加载glTF/glb
    • noUI:禁用 UI
    • yaw=90:沿 Y 轴绕模型运行相机(以度为单位)。使用 90 度,您可以从左侧查看模型。
    • pitch=90:使相机沿 X 轴绕模型运行(以度为单位)。使用 90 度,您可以从顶部查看模型。值范围:-90 至 90
    • distance=5:模型在正数时变小,负数时变大。相对于初始摄像机位置。

    设置

    本地使用和调试,请按照以下说明作:

    1. 签出分支

    2. 拉取所需 glTF-Sample-Renderer 的子模块 git submodule update --init --recursive

    3. 生成 Web 应用

    进行更改时,项目会自动重新生成,目录中填充 Web 应用程序。此目录包含部署到 Web 服务器所需的所有文件。./dist

    调试

    • 要求
    • 安装适用于 Visual Studio Code 的 Debugger for Chrome 或 Debugger for Firefox 扩展
    • 在 Visual Studio Code 中打开项目目录,然后选择或创建文件。Debug->Add Configuration->ChromeDebug->Add Configuration->Firefox.vscode/launch.json
    • 对于 chrome:在文件中追加到/dist${workspaceFolder}launch.json
    • Debug->Start Debugging现在应该使用示例查看器启动 Chrome 或 Firefox 窗口,并且应该命中 VS Code 断点。

    已知问题

    npm install / npm run dev 给出以下警告:

    以下警告来自第三方,不会影响示例查看器,因为从未执行上述第 179 行。

    (!) "this" has been rewritten to "undefined"
    https://rollupjs.org/troubleshooting/#error-this-is-undefined
    node_modules/iobuffer/lib-esm/text-encoding-polyfill.js
    177:     : typeof self !== 'undefined'
    178:         ? self
    179:         : this);
                   ^
    180: //# sourceMappingURL=text-encoding-polyfill.js.map
    

    以下警告是由旧的 bulma 版本引起的,buefy-next 目前依赖于该版本。 这应该在即将发布的版本中修复:ntohq/buefy-next#208

    [0] [build] DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
    [0] rules will be changing to match the behavior specified by CSS in an upcoming
    [0] version. To keep the existing behavior, move the declaration above the nested
    [0] rule. To opt into the new behavior, wrap the declaration in `& {}`.
    [0]
    [0] More info: https://sass-lang.com/d/mixed-decls
    [0]
    [0]    ╷
    [0] 51 │ ┌   &:not(.is-rounded)
    [0] 52 │ │     border-radius: $radius-small
    [0]    │ └─── nested rule
    [0] 53 │     font-size: $size-small
    [0]    │     ^^^^^^^^^^^^^^^^^^^^^^ declaration
    [0]    ╵
    [0]     node_modulesbulmasasselementsbutton.sass 53:3   button-small()
    [0]     node_modulesbulmasasselementsbutton.sass 252:5  @import
    [0]     node_modulesbulmasasselements_all.sass 5:9      @import
    [0]     node_modulesbulmabulma.sass 5:9                   @import
    [0]     stdin 60:9                                          root stylesheet
    

    以下警告源自 rollup 复制插件,该插件仅用于开发将文件复制到 dist 文件夹。

    npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
    npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
    npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
    npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
    npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
    npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
    npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
    

    大约

    glTF 2.0 中使用 WebGL 进行基于物理的渲染

    资源

    许可证

    行为准则

    星星

    观察家

    释放3

    1.0.10 版本最近的
    on Mar 8, 2023

    未发布包
    1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
    2. 分享目的仅供大家学习和交流,请不要用于商业用途!
    3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入!
    4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
    5. 如有链接无法下载、失效或广告,请联系管理员处理!
    6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
    7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员!
    8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载
    声明如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性

    GLB下载网 - GLB/GLTF模型与格式资源免费下载,支持在线浏览与转换 » glTF 2.0 中使用 WebGL 进行基于物理的渲染

    常见问题FAQ

    免费下载或者VIP会员专享资源能否直接商用?
    本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
    提示下载要提取码
    百度网盘提取码都是gltf。
    分享过期和重复下载怎么办
    分享过期请使用备份下载,重复下载是不另扣费的,请放心下载。
    模型和平台不兼容怎么办
    可以用网站在线编辑功能,修改模型属性,大小,方向,坐标,中心,透明等问题,然后重新导出既可https://glbxz.com/38636.html
    开通VIP 享更多特权,建议使用 QQ 登录