android - Arcore:将特征点设置为点(而不是金字塔)
问题描述
我从这里找到了一个很棒的参考,用于自定义和显示 AR 特征点。
它工作得很好,但它显示了金字塔,我需要显示这样的扁平白点:
我需要写什么来显示白点而不是金字塔?
更新:这就是我最终所做的并且效果很好:
if (this.timestamp != cloud.timestamp && materialHolder.getNow(null) != null) {
timestamp = cloud.timestamp
val buf = cloud.points
// Point clouds are 4 values x,y,z and a confidence value.
numOfFeaturePoints = buf.limit() / 4
// no features in the cloud
if (numOfFeaturePoints < 1) {
renderable = null
return
}
if (isInProcess) {
return
}
isInProcess = true
// remove current feature points
for (child in children) {
child.renderable = null
}
// add the new feature points as dots
val feature = Vector3()
for (i in 0 until buf.limit() / 4) {
// feature point
feature.x = buf.get(i * 4)
feature.y = buf.get(i * 4 + 1)
feature.z = buf.get(i * 4 + 2)
val node = Node()
node.renderable = ShapeFactory.makeCylinder(0.01f, 0.001f, Vector3(feature.x, feature.y, feature.z), myMaterial)
node.renderable!!.isShadowCaster = false
node.setParent(this)
}
isInProcess = false
}
解决方案
推荐阅读
- javascript - 如何将 Google Maps 与 Marko.js 和 Lasso.js 一起使用并将全局变量链接到其他模板
- visual-studio-code - 我无法在 Visual Studio Code 中输入 \
- kubernetes - Ansible、k8s 和变量
- c - 为什么我应该使用 fork() 在 C 中制作简单的 shell
- haskell - 当传递给返回 Just x 的 lambda 时,Haskell 如何知道将 Nothing 保留为空?
- python - 使用神经网络学习分类值的分布
- ios - 向 UITableViewCell 添加了 Autolayout,但我看到了一个未知现象
- ansible - 在 Ansible 中组合字符串列表
- javascript - SignalR 的新手,有没有办法在用户执行操作时向其他人广播,而不仅仅是在他们开始和完成时?
- c - C中的指针仅在调用方法时更新一次