swift – 如何将SCNNode移动到ARCamera下方?

栏目: Swift · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/46506231/how-to-move-an-scnnode-to-just-below-arcamera

我正在制作一个增强现实应用程序,用户必须向目标扔球.我使用以下代码将球定位在屏幕前方10厘米处:

var translation = matrix_identity_float4x4
    translation.columns.3.z = -0.1
    print(translation.debugDescription)
    print(frame.camera.transform)
    projectile.simdTransform = matrix_multiply(frame.camera.transform, translation)

目前游戏看起来像这样,但我想把球移到靠近屏幕的底部.

https://www.dropbox.com/s/4e122i5mtrti6fu/Screen%20Shot%202017-09-30%20at%203.16.15%20PM.png?dl=0

我最终找到了解决方案:

替换以下行

translation.columns.3.z = -0.1

translation.columns.3.x = -0.1

翻译自:https://stackoverflow.com/questions/46506231/how-to-move-an-scnnode-to-just-below-arcamera


以上所述就是小编给大家介绍的《swift – 如何将SCNNode移动到ARCamera下方?》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Hard Thing About Hard Things

The Hard Thing About Hard Things

Ben Horowitz / HarperBusiness / 2014-3-4 / USD 29.99

Ben Horowitz, cofounder of Andreessen Horowitz and one of Silicon Valley's most respected and experienced entrepreneurs, offers essential advice on building and running a startup—practical wisdom for ......一起来看看 《The Hard Thing About Hard Things》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

MD5 加密
MD5 加密

MD5 加密工具

html转js在线工具
html转js在线工具

html转js在线工具