• 正文概述
  • GitHub – bwasty/gltf-viewer:用 Rust 编写的 glTF 2.0 查看器

    Name
    EFCA5A9 · 6 months ago
    8 years ago
    8 years ago
    6 months ago
    7 years ago
    7 years ago
    7 years ago
    7 years ago
    7 years ago
    6 months ago
    6 months ago
    6 years ago
    8 years ago
    7 years ago
    7 years ago
    7 years ago
    7 years ago
    6 months ago
    7 years ago

    gltf-查看器用 Rust 编写的 glTF 2.0 查看器

    Rust glTF 2.0 查看器,使用 gltf crate 和普通 OpenGL 编写。

    当前状态:所有官方示例模型都可以加载,并使用参考 PBR 着色器进行渲染。示例:
    科幻头盔
    包含所有示例模型的库:https://bwasty.github.io/gltf-viewer/0.3.0/

    一些 glTF 功能尚未实现,最显着的是动画。有关详细信息,请参阅 #3

    安装

    二进制文件 (Win/Linux/macOS)

    查看最新版本

    From crate(需要 Rust)

    cargo install gltf-viewer

    最新版本(不稳定):

    cargo install --git https://github.com/bwasty/gltf-viewer.git

    用法

    USAGE:
        gltf-viewer [OPTIONS] <FILE>
    
    OPTIONS:
        -v, --verbose                    Enable verbose logging (log level INFO). Can be repeated up to 3 times to increase
                                         log level to DEBUG/TRACE)
        -s, --screenshot <FILE>          Create screenshot (PNG)
        -w, --width <WIDTH>              Width in pixels [default: 800]
        -h, --height <HEIGHT>            Height in pixels [default: 600]
        -c, --count <COUNT>              Saves N screenshots of size WxH, rotating evenly spaced around the object [default:
                                         1]
            --headless                   Use real headless rendering for screenshots (default is a hidden window)
                                         [EXPERIMENTAL - see README for details]
            --straight                   Position camera in front of model if using default camera (i.e. glTF doesn't
                                         contain a camera or `--cam-index -1` is passed).
            --scene <scene>              Index of the scene to load [default: 0]
            --cam-index <CAM-INDEX>      Use the glTF camera with the given index (starting at 0).
                                         Fallback if there is none: determine 'nice' camera position based on the scene's
                                         bounding box. Can be forced by passing -1.
                                         Note: All other camera options are ignored if this one is given. [default: 0]
            --cam-pos <CAM-POS>          Camera (aka eye) position override as comma-separated Vector3. Example: 1.2,3.4,5.6
            --cam-target <CAM-TARGET>    Camera target (aka center) override as comma-separated Vector3. Example:
                                         1.2,3.4,5.6
            --cam-fovy <CAM-FOVY>        Vertical field of view ('zoom') in degrees. [default: 75]
            --help                       Prints help information
        -V, --version                    Prints version information
    
    ARGS:
        <FILE>    glTF file name
    

    支持 .gltf 和 .glb 文件。 使用鼠标导航场景:左键单击 + 拖动旋转,右键单击 + 拖动平移,使用鼠标滚轮缩放。

    $ curl -O https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Box/glTF-Binary/Box.glb
    $ gltf-viewer Box.glb
    

    无头截图生成

    使用标志生成正确的无头屏幕截图目前仅适用于 macOS。 为了解决这个问题,提供了一个使用 Docker 设置。使用示例:--headlessxvfb

    # Build docker image and run it with the gltf mounted in a volume.
    # The image will be saved next to the gltf file.
    ./screenshot_docker.sh Box.glb
    ./screenshot_docker.sh ../models/Box.gltf -w 1920 -h 1080 --count 3 -vv
    # Use pre-built docker image from Docker Hub
    DOCKER_IMAGE=bwasty/gltf-viewer ./screenshot_docker.sh Box.glb
    

    或者,您也可以直接安装和使用(仅限 Linux)。xvfb./run_xvfb.sh

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

    GLB下载网 - GLB/GLTF模型与格式资源免费下载,支持在线浏览与转换 » 用 Rust 编写的 glTF 2.0 查看器

    常见问题FAQ

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