Designing a script which unwraps the net of any object to a plane

Hi all,

I want to take any 3D mesh and unwrap its net onto a plane in real time, so that all faces of it can be seen at once. This is like taking a cube and opening it up and putting its six faces onto a flat sheet of paper, except this must work with any object. http://en.wikipedia.org/wiki/Net_(polyhedron)

The camera will have a top down perspective of course of the unwrapped objects. I suppose that making the normals of each face equal to the camera’s normal would work, but I would like some suggestions. Many thanks,

1/1 credit(s)

You probably could do it with Python and just access the mesh(es) of the object, but the easiest method would probably be to make a shape action or an Armature action of the unfolding actions.

there is an unwrap script (I do not know the name) but … it is not a BGE script. What you want is not that easy, if the faces shouldn’t overlap.

Yes, I want the objects to be completely unwrapped, like they were made of paper and folded up into shapes. Every face must be visible - there must be no overlapping.

If the mesh has structures on top of it, like airvents on a building, the unwrapped structures should be placed adjacent to the unwrapped object, so they can be visible as well, rather like a parent and child system.

I suppose that this would all be quite simple if a picture of each face could be taken before each frame is rendered, then arranged as required and projected onto a plane as a texture. The texture would update every frame of course, showing the objects as if they were projected onto a flat plane. Does anyone have any ideas? The problem is if I try to manipulate the meshes in realtime, it will obviously make the game behave unexpectedly - I only want to create the ability to see every side of the object at once, not actively change the shape of it.

Hmm… What’s this for? Perhaps there’s a way to bypass this whole system as it’s quite complex. If I get you right, it seems like you want to take a 3D mesh to unwrap it like a UV map, so that each face is visible, right? I still think that the best way would be with a predefined animation for each object, as to do it with Python seems like it would be far too inefficient for high-poly objects and difficult to code.

I still do not know, why you need this in the BGE.
But you could check for unfold. It can be used to produce paper models from your Blender models.
See this thread:
http://blenderartists.org/forum/showthread.php?t=101194&page=1

I remember I saw a video with someone creating a papermodel of his own face.

I tried with my monster model. And I can tell you it is really, really hard to get non-overlapping faces if you want it in as less as possible pieces.

I just managed the head, but never finished the papermodel.