The_Martian
The_Martian

Reputation: 3767

Programmatically convert 2D image to 3D renderable using android sceneform

All the tutorials and blogs out there show how to build Renderable:

ModelRenderable.builder()
               .setSource(this, <Path of 3D model>)
               .build()
               .thenAccept(renderable -> myRedenderable = renderable)

using the sceneform plugin in android studio. But I would like to build a 3D Renderable on the fly from a 2D .png image or something uploaded by the user. How can I achieve that?

Upvotes: 0

Views: 1580

Answers (1)

MathankumarK
MathankumarK

Reputation: 2905

Use ViewRendarable to place a 2d View

// Build a renderable from a 2D View.
    CompletableFuture<ViewRenderable> solarControlsStage =
        ViewRenderable.builder().setView(this, R.layout.file_name).build();

To find more detail about placing 2D View Look at google Ar solar system sample

Upvotes: 1

Related Questions