flutter_cube
flutter_cube copied to clipboard
Can I change texture with onTap?
It would be so much better if I could change the texture bc Flutter Cube is the best 3d flutter package compatible with me.
loadImageFromAsset('assets/texture.png').then((value) {
object.mesh.texture = value;
scene.updateTexture();
});
Hi sorry to bother you again... Let's say I have an obj with different textures like a tree obj which will have leaves texture and trunk texture.So I don't know how to change texture on specific location. I'm wondering "What if we could change the mtl file of the obj?" Thanks you for your effort.
Use Blender to separate tree to two objects, name “leaves” and “trunk”, then export to "tree.obj". Code:
object.find(RegExp('leaves')).mesh.texture = value1;
object.find(RegExp('trunk')).mesh.texture = value2;
scene.updateTexture();