Current Shapeshifting Technology
There are a number of shapeshifting technologies capable of doing something like what you're asking about. Here are three that are close, and I'm listing programmable matter first because I think it's the closest fit to what you describe, but claytronics is a close second. Most of these are funded at least in part by the U.S. military's research and development branch DARPA.
A revolutionary new technology called programmable matter may allow future warfighters to command their equipment to physically change itself to meet new operational needs or to form spare parts or tools. Researchers are developing techniques to order materials to self-assemble or alter their shape, perform a function and then disassemble themselves. These capabilities offer the possibility for morphing aircraft and ground vehicles, uniforms that can alter themselves to be comfortable in any climate, and “soft” robots that flow like mercury through small openings to enter caves and bunker complexes.
In the future a soldier will have something that looks like a paint can in the back of his vehicle. The can is filled with particles of varying sizes, shapes and capabilities. These individual bits can be small computers, ceramics, biological systems—potentially anything the user wants them to be. The soldier needs a wrench of a specific size. He broadcasts a message to the container, which causes the particles to automatically form the wrench. After the wrench has been used, the soldier realizes that he needs a hammer. He puts the wrench back into the can where it disassembles itself back into its components and re-forms into a hammer.
Claytronics is a form of programmable matter. Imagine a bracelet or watch that changes into something else when you take it off. Perhaps it becomes a cell phone, or laptop computer. Although this scenario may seem like science fiction, this and much more will soon become reality with a ground-breaking new technology known as claytronics.
Scientists at Carnegie Mellon University and Intel Research Labs Pittsburgh are just a few years away from bringing to life a futuristic simulation system that can morph nearly any object imagined into another object with different size, shape, color and function.
The building units that make this amazing system possible include tiny micro robots called claytronic atoms, or ‘catoms’, which interact with each other. They behave like atoms in the sense that they become the basic building blocks of the objects they are programmed to form. Here is a demo video.
Each component becomes part of a computerized network of objects and identifies itself based on function; for example, a catom might see itself as part of a human body. On command, millions, or even billions of catoms working together would fall in place to create, in this case, a replicate of a live person.
With claytronics, matter can be transformed into any shape for any purpose. Furniture could change shape; blank walls could grow doors or windows. Catoms could form into people that we would find difficult to discern from the real person. They would appear as an actual physical being, not a hologram.
SquishBot is a DARPA program to develop a new class of soft, shape-changing robot. The goal is to design systems that can transform themselves from hard to soft and from soft to hard, upon command. Another goal is to create systems that change their critical dimensions by large amounts, as much as 10x. Such robots will be like soft animals that can squeeze themselves through small openings and into tight places.