Android Arcore:将要素点设置为点(而不是棱锥体)
我从中找到了一个很棒的参考,用于定制和显示AR功能点 它工作得很好,但它显示的是金字塔,我需要像这样显示平面白点: 我需要写什么来显示白点而不是金字塔 更新:这就是我最后做的,效果很好:Android Arcore:将要素点设置为点(而不是棱锥体),android,arcore,point-clouds,sceneform,Android,Arcore,Point Clouds,Sceneform,我从中找到了一个很棒的参考,用于定制和显示AR功能点 它工作得很好,但它显示的是金字塔,我需要像这样显示平面白点: 我需要写什么来显示白点而不是金字塔 更新:这就是我最后做的,效果很好: if (this.timestamp != cloud.timestamp && materialHolder.getNow(null) != null) { timestamp = cloud.timestamp val buf = cloud.points
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
}
if(this.timestamp!=cloud.timestamp&&materialHolder.getNow(null)!=null){
timestamp=cloud.timestamp
val buf=云点
//点云是4个值x、y、z和一个置信值。
numofeaturepoints=buf.limit()/4
//云中没有任何功能
如果(numofeaturepoints<1){
renderable=null
返回
}
如果(isInProcess){
返回
}
isInProcess=true
//删除当前要素点
用于(儿童中的儿童){
child.renderable=null
}
//将新要素点添加为点
val feature=Vector3()
for(在0中输入i直到buf.limit()/4){
//特征点
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(此)
}
isInProcess=false
}
什么是isInProccess?@NoumanShah一个不中断for循环的标志,如何放置锚