sceneview-android icon indicating copy to clipboard operation
sceneview-android copied to clipboard

How to combine multiple node into one

Open lascadeansal opened this issue 2 years ago • 1 comments

Read my code below here i have 3 3d model i want to combine this into one model

val train1: CompletableFuture<ModelRenderable> = ModelRenderable
    .builder()
    .setSource(applicationContext, Uri.parse("3d/new/Train_Cabin_01_Go.glb"))
    .setIsFilamentGltf(true)
    .build()
val train2: CompletableFuture<ModelRenderable> = ModelRenderable
    .builder()
    .setSource(applicationContext, Uri.parse("3d/new/Train_Cabin_02_Go.glb"))
    .setIsFilamentGltf(true)
    .build()
val train3: CompletableFuture<ModelRenderable> = ModelRenderable
    .builder()
    .setSource(applicationContext, Uri.parse("3d/new/Train_Cabin_03_Go.glb"))
    .setIsFilamentGltf(true)
    .build()
CompletableFuture.allOf(train1,train2,train3)
    .handle<Any?> { ok: Void?, ex: Throwable? ->
        modelNode = Node()
   }

lascadeansal avatar Dec 29 '23 05:12 lascadeansal

You can add them all in childNodes as a list and they will be all shown in the scene. Something like this, you can see childNodes: Scene(modifier = Modifier.fillMaxSize(), engine = engine, modelLoader = modelLoader, cameraNode = cameraNode, childNodes = listOf( centerNode, movingObjectNode, ... //add all the 3D models you want ), environment = ..., onFrame = {...})

natasam avatar Jan 02 '24 16:01 natasam

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 02 '24 05:04 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Apr 10 '24 05:04 github-actions[bot]