How can we change color of 3D model #62
Unanswered
suryanadiminti99
asked this question in
Q&A
Replies: 2 comments
-
Any update on this? It was quite simple to do in the original sceneform but doesn't seem to be possible here which is strange |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sorry for my late answer. If you are talking about a 3d cube which is generated with this function call MaterialFactory.makeOpaqueWithColor(this, color)
.thenAccept { material: Material? ->
val renderable: Renderable = ShapeFactory.makeCube(
Vector3(0.1f, 0.1f, 0.1f).scaled(1f),
Vector3(0.0f, 0.0f, 0.0f).scaled(1f),
material
)
val anchor: Anchor? = hitResult?.createAnchor()
val anchorNode = AnchorNode(anchor)
anchorNode.setParent(arFragment!!.arSceneView.scene)
val node: Node = Node()
node.renderable = renderable
node.setParent(anchorNode)
GlobalScope.launch(context = Dispatchers.Main) {
delay(2000)
val color1: Color = Color(1f,0f,0f,0f)
renderable.material.setFloat3("color", color1)
}
} You can change the color with val color1: Color = Color(1f,0f,0f,0f)
renderable.material.setFloat3("color", color1) I guess you tried The same should work with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@ThomasGorisse @vortice3D @RGregat @jthoeny @senthil5053
Is it possible to change color of 3d object ? Its a plain 3d cube .
Beta Was this translation helpful? Give feedback.
All reactions