I have to display a 2d image and don't want to use 3d objects with .obj file.Is it even possible? And how to do it?
Asked
Active
Viewed 674 times
1
Andy Jazz
- 36,357
- 13
- 107
- 175
chaitanya Harde
- 186
- 1
- 7
-
check this post it would be helpful https://stackoverflow.com/questions/52251070/how-to-display-png-image-in-arcore – Bilz Jan 24 '20 at 07:58
1 Answers
0
You can use three robust approaches, in your case, to create Sceneform's
Renderable:
First approach is to create a
plane primitivewith a.jpgor.pngtexture assigned to it.ModelRenderable plane = ShapeFactory.makeCube( new Vector3(5.0f, 5.0f, 0.0f), // size new Vector3(0.0f, 0.0f, 0.0f), // center material);Second approach is to create a
ViewRenderablefrom standardAndroid Widgets.ViewRenderable.builder() .setView(this, R.layout.test_view) .build() .thenAccept(renderable -> testViewRenderable = renderable);Third approach is to import a plane made in 3d authoring tool (Maya, 3dsMax, Cinema4D, etc).
ModelRenderable.builder() .setSource(this, RenderableSource.builder().setSource( this, Uri.parse(ASSET), RenderableSource.SourceType.OBJ) .setScale(2.0f) .setRecenterMode(RenderableSource.RecenterMode.ROOT) .build()) .setRegistryId(ASSET) .build()
Andy Jazz
- 36,357
- 13
- 107
- 175