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下方?》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

Weaving the Web

Weaving the Web

Tim Berners-Lee / Harper Paperbacks / 2000-11-01 / USD 15.00

Named one of the greatest minds of the 20th century by Time , Tim Berners-Lee is responsible for one of that century's most important advancements: the world wide web. Now, this low-profile genius-wh......一起来看看 《Weaving the Web》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

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

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具