首页 > 解决方案 > 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
    }

标签: androidarcorepoint-cloudssceneform

解决方案


推荐阅读