Arcore:将要素点设置为点(而不是金字塔)

问题描述 投票:1回答:1

我从here找到了很棒的参考,用于自定义和显示AR功能点。

[效果很好,但是它显示了金字塔,我需要显示像这样的平白点:

enter image description here

我需要写些什么来显示白点而不是金字塔?

更新:那是我最终所做的,并且效果很好:

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
    }
android arcore point-clouds sceneform
1个回答
0
投票

isInProcess是静态的?什么是myMaterial

© www.soinside.com 2019 - 2024. All rights reserved.