收藏
回答

我想知道想在微信中的h5使用ar怎么做?是否支持使用ar.js?我现在使用ar.js无法调用摄像头。

<!--在图像描述符加载前显示 loading,根据设备的计算力,加载可能需要一点时间。-->

  <div class="arjs-loader">

    <div>Loading, please wait...</div>

  </div>


  <!-- a-frame scene -->

  <a-scene denyButtonText="拒绝" allowButtonText="同意" cancelButtonText="返回" deviceMotionMessage="ar功能需要访问您的设备运动传感器权限"

    vr-mode-ui="enabled: false;" renderer="logarithmicDepthBuffer: true;" embedded

    arjs="trackingMethod: best; sourceType: webcam;debugUIEnabled: false;">

    <!-- a-nft是定义图像跟踪实体的锚点 -->

    <!-- 在 url 使用到图像描述符的路径之前创建 -->

    <!-- 路径应该以名称结束,无需扩展名。举例来说,如果文件是“pinball.fset”那么路径的结尾单次就是“pinball” -->

    <a-nft id="a_nft" markerhandler type="nft" url="ff/ff" smooth="true" smoothCount="10" smoothTolerance=".01"

      smoothThreshold="5">

      <!-- 作为 a-nft 的子元素,您可以定义要显示的内容。下面是一个 GLTF 模型实体 -->

      <!-- <a-entity gltf-model="" scale="5 5 5" position="0 0 0">

        <a-box color="#333333" height="200" width="200"></a-box>

      </a-entity> -->

    </a-nft>

    <!-- 静态摄像机,根据设备的运动参数进行移动 -->

    <a-entity camera look-controls="enabled: false"></a-entity>

  </a-scene>


回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容