首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AR.JS使长方体扁平

AR.JS使长方体扁平
EN

Stack Overflow用户
提问于 2018-06-11 22:30:38
回答 1查看 697关注 0票数 0

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

我的代码附在下面:

代码语言:javascript
复制
<!-- 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>
EN

回答 1

Stack Overflow用户

发布于 2018-06-11 22:55:30

请尝试使用<a-plane>

代码语言:javascript
复制
<a-plane position='0 1.0 0' material='src:https://.com/playground/aframe/examples/img/coffee-01.png;'></a-plane>

工作代码here

如果你看不到飞机,可能是旋转的问题:

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50800143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档