微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AR.js - 3D 模型 (GLTF) 晃动、振动并脱离标记

如何解决AR.js - 3D 模型 (GLTF) 晃动、振动并脱离标记

希望你们一切顺利。

我正在测试 gltf 格式的狗的 3D 模型。我的目标是通过 AR.js 框架使其在标记上顺利运行,为此,我使用 AR.js studio (https://ar-js-org.github.io/studio/) 创建了一个包。但是,我现在面临一个问题;动画狗的 3D 模型闪烁/摇晃/振动并脱离标记,我需要使其完美平滑和对齐。它将出现在 AR.js Studio 上的标记上。有人可以帮我解决这个问题吗?我附上了以下测试链接代码https://katumatestdemo.s3.us-east-2.amazonaws.com/moondogetest/index.html

    <!doctype html>
<html>
<head>
    <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
    <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
    <script src="https://raw.githack.com/donmccurdy/aframe-extras/master/dist/aframe-extras.loaders.min.js"></script>
    <script src="https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-detector.js"></script>
    <script src="https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-handler.js"></script>
</head>

<body style="margin: 0; overflow: hidden;">
    <a-scene
        vr-mode-ui="enabled: false;"
        loading-screen="enabled: false;"
        renderer="logarithmicDepthBuffer: true;"
        arjs="trackingMethod: best; sourceType: webcam; debugUIEnabled: false;"
        id="scene"
        embedded
        gesture-detector
    >
        <a-assets>
            <a-asset-item
                id="animated-asset"
                src="assets/asset.gltf"
            ></a-asset-item>
        </a-assets>

        <a-marker
            id="animated-marker"
            type="pattern"
            preset="custom"
            url="assets/marker.patt"
            raycaster="objects: .clickable"
            emitevents="true"
            cursor="fuse: false; rayOrigin: mouse;"
            id="markerA"
        >
            <a-entity
                id="bowser-model"
                position="0 -180 0"
                scale="0.299302177299028000 0.299302177299028000 0.299302177299028000"
                animation-mixer="loop: repeat"
                gltf-model="#animated-asset"
                class="clickable"
                gesture-handler
            ></a-entity>
        </a-marker>
        <a-entity camera></a-entity>
    </a-scene>
    </body>
    </html>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。