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

ViewNode2 not rendering

Open PinkBabyBoy opened this issue 5 months ago • 8 comments

Trying to do smth like this in template below. If use CubeNode - rendering is ok.

                    val cNode2 = ViewNode2(
                        engine,
                        wn.value,
                        materialLoader,
                        content = {
                            MaterialTheme {
                                Box(Modifier.fillMaxSize()) {
                                    Image(
                                        painterResource(ai.tourly.core.R.drawable.v_ic_microphone),
                                        null,
                                        modifier = Modifier.size(200.dp))
                                }
                            }
                        }
                    ).apply {
                        isPositionEditable = true
                        isScaleEditable = true
                        scale = Scale(2f, 2f, 2f)
                        isEditable = true
                        onEditingChanged = {
                            anchorNode.isVisible = true
                            isVisible = true
                        }
                     
                    }
                    val boundingBoxNode = CubeNode(
                        engine,
                        size = dev.romainguy.kotlin.math.Float3(200f, 200f, 200f),
                        center = dev.romainguy.kotlin.math.Float3(50f, 50f, 50f),
                        materialInstance = materialLoader.createColorInstance(
                            Color.Black.copy(
                                alpha = 0.5f
                            )
                        )
                    ).apply {
                        isVisible = true
                    }
                    anchorNode.addChildNode(cNode2)

                    anchorNode
                }
                nodes.addAll(ancors)

PinkBabyBoy avatar May 16 '25 12:05 PinkBabyBoy