0

我正在使用我的 AR.JS 在 AR 图案上显示图像。我想知道是否可以把它做成一个不完整的盒子,而只做成一个盒子,所以当我向上移动相机时,我看不到盒子的大小和顶部?我认为改变位置/大小会做到这一点,但这不起作用。有人有什么想法吗?由于大多数人想要 3D,因此似乎没有太多关于此的信息。

附上我的代码:

<!-- include a-frame -->
<script src="vendor/aframe/build/aframe.min.js"></script>

<!-- include ar.js for aframe -->
<script src='../build/aframe-ar.js'></script>
<script>ARjs.Context.baseURL = '../../three.js/'</script>

<!-- start the body of your page -->
<body style='margin : 0px; overflow: hidden;'>
    <!-- add some info at the top of the page -->
    <div style='position: fixed; top: 10px; width:100%; text-align: center; z-index: 1; color:white; font-size:30px;'>
        <a>Prototype Coffee</a>
    </div>

    <!-- Define your 3d scene and enabled ar.js -->
    <a-scene embedded arjs='trackingMethod: best; debugUIEnabled: false;'>

        <!-- Create a anchor to attach your augmented reality -->
        <a-anchor hit-testing-enabled='true'>

            <!-- Add your augmented reality here -->
            <a-box position='0 1.0 0' material='side:single; src:https://.com/playground/aframe/examples/img/coffee-01.png;'>

        </a-anchor>

        <!-- Define a static camera -->
        <a-camera-static/>

    </a-scene>
</body>
4

1 回答 1

1

尝试<a-plane>改用:

<a-plane position='0 1.0 0' material='src:https://.com/playground/aframe/examples/img/coffee-01.png;'></a-plane>

在这里工作codepen 。

如果您看不到飞机,则可能是旋转问题: 在此处输入图像描述

于 2018-06-11T14:55:30.327 回答