首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在ARCore中显示从服务器获取的图片?

如何在ARCore中显示从服务器获取的图片?
EN

Stack Overflow用户
提问于 2018-12-27 21:09:39
回答 1查看 523关注 0票数 2

我正在使用ARCore构建一个应用程序,我想在其中显示来自服务器的图像。我不想使用obj,.smf,imgdb文件和3D图像。我已经参考了许多链接,但没有一个显示如何使用Arcore显示从服务器获取的图像。

代码语言:javascript
复制
val getImageURL = media["cLeft"]
    Log.e("workImageURL", "$getImageURL")
    Glide.with(this)
            .setDefaultRequestOptions(RequestOptions().error(R.drawable.ic_logo))
            .load(getImageURL)
            .into(imageCard)

    ViewRenderable.builder()
            .setView(this, R.layout.layout_ar_object_image)
            .build()
            .thenAccept { renderable ->
                andyRenderable = renderable
            }

  arFragment.setOnTapArPlaneListener { hitResult: HitResult, plane: Plane, motionEvent: MotionEvent ->

        val anchor = hitResult.createAnchor()
        val anchorNode = AnchorNode(anchor)

        anchorNode.setParent(arFragment.arSceneView.scene)

        // Create the transformable andy and add it to the anchor.
        val andy = TransformableNode(arFragment.transformationSystem)
        andy.setParent(anchorNode)
        andy.renderable = andyRenderable
        andy.select()
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-28 01:48:30

为了显示从服务器加载的图像,您需要使用ViewRenderables和ImageView。然后,您可以在ImageView中加载图像(使用任何您喜欢的库,例如Glide或Picasso),并使用ViewRenderable将此ImageView附加到Sceneform节点。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53945638

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档