Hi! Is it possible to “slice” a cube using a plane? I have a cube and a plane in my scene and when I press spacebar the plane slices the cube and the top part of cube disappears showing its height. If it is possible what methods I should use?
To be honest, I don’t have any idea how to do this with Haxe, however I imagine it would have something to do with using Booleans via Blender’s python API…
Thanks alot for the advice! Can I make some interactive game alike using py api?
Blender’s Python api really just gives you access to the functions of Blender itself, and Blender doesn’t have a game engine in it (well, not any more). That’s what you use Armory for. While Armory is coded in Haxe and uses Haxe for it’s scripting, it uses Python to interact with to Blender.
There is a mesh-destruction bundled script included in Armory, it uses quite complicated Haxe code (imo, there is maths n stuff), but it seems to work with the premise of planes, only that it uses multiple of them.
Regarding bundles: I’d check out point 7 of this thread:
Splitting the cube would require modifying the mesh at runtime using Haxe, like the PhysicsBreak example that @Simonrazer mentioned, but I haven’t done it myself and I don’t know exactly how to do it. Another example that might be useful is the mesh generation example.