The three types of rock are: metamorphic (from pre-existing rocks) and igneous. Sedimentary is formed by pieces of previously-living organisms or rocks. Wind, rain and ice break down these rocks over time. Metamorphic rocks have been altered by heat, chemical activity, or pressure. These changes can occur deep underground, where the Earth's core heats the rock. They can also happen on the surface of the Earth when a rock is exposed by a volcano to high temperatures or pressures, or when it collides with another rock. Igneous rocks form when hot magma cools down and hardens. The resulting rock has large crystals if the magma is cooled slowly. If the magma is cooled quickly, then the rock that results will have smaller crystals.