Arthropod eye
Apposition eyes are the most common form of eye, and are presumably the ancestral form of compound eye. They are found in all arthropod groups, although they may have evolved more than once within this phylum. Some annelids and bivalves also have apposition eyes. They are also possessed by "Limulus", the horseshoe crab, and there are suggestions that other chelicerates developed their simple eyes by reduction from a compound starting point. Some caterpillars appear to have evolved compound eyes from simple eyes in the opposite fashion. The arthropods ancestrally possessed compound eyes, but the type and origin of  this eye varies between groups, and some taxa have secondarily developed simple eyes. The organ's development through the lineage can be estimated by comparing groups that branched early, such as the velvet worm and horseshoe crab to the advanced eye condition found in insects and other derived arthropods. Eyes and functions. Most arthropods have at least one of two types of eye: lateral compound eyes, and smaller median ocelli, which are simple eyes. When both are present, the two eye types are used in concert because each has its own advantage. Some insect larvae, e.g., caterpillars, have a different  type of simple eye known as stemmata. These eyes usually provide only a rough image, but (as in sawfly larvae) they can possess resolving powers of 4 degrees of arc, be polarization sensitive and capable of increasing their absolute sensitivity at night by a factor of 1,000 or more. Flying insects can remain level with either type of eye surgically removed, but the two types combine to give better performance. Ocelli can detect lower light levels, and have a faster response time, while compound eyes are better at detecting edges and are capable of forming images. Anatomical distribution of compound  eyes. Most species of Arthropoda with compound eyes bear just two eyes that are located separately and symmetrically, one on each side of the head. This arrangement is called dichoptic. Examples include most insects, and most of the larger species of Crustacea, such as crabs. Many other organisms, such as vertebrates and Cephalopoda are similarly and analogously dichoptic, which is the common state in animals that are members of the Bilateria and have functionally elaborate eyes. However, there are variations on that scheme. In some groups of animals whose ancestors originally were dichoptic, the eyes of modern species may be  crowded together in the median plane; examples include many of the Archaeognatha. In extreme cases such eyes may fuse, effectively into a single eye, as in some of the Copepoda, notably in the genus Cyclops. One term for such an arrangement of eyes is cycloptic. On the other hand, some modes of life demand enhanced visual acuity, which in compound eyes demands a larger number of ommatidia, which in turn demands larger compound eyes. The result is that the eyes occupy most of the available surface of the head, reducing the area of the frons and the vertex and crowding  the ocelli, if any. Though technically such eyes still may be regarded dichoptic, the result in the extreme case is that borders of such eyes meet, effectively forming a cap over most of the head. Such an anatomy is called holoptic. Spectacular examples may be seen in the Anisoptera and various flies, such as some Acroceridae and Tabanidae. In contrast, the need for particular functions may not require extremely large eyes, but do require great resolution and good stereoscopic vision for precise attacks. Good examples may be seen in the Mantodea and Mantispidae, in which seeing prey from particular ommatidia  in both compound eyes at the same time, indicates that it is in the right position to snatch in a close-range ambush. Their eyes accordingly are placed in a good position for all-round vision, plus particular concentration on the anterior median plane. The individual ommatidia are directed in all directions and accordingly, one may see a dark spot (the pseudopupil), showing which ommatidia are covering that field of view; from any position on the median plane, and nowhere else, the two dark spots are symmetrical and identical. Sometimes the needs for visual acuity in different functions conflict, and  different parts of the eyes may be adapted to separate functions; for example, the Gyrinidae spend most of their adult lives on the surface of water, and have their two compound eyes split into four halves, two for underwater vision and two for vision in air. Again, particularly in some Diptera, ommatidia in different regions of the holoptic male eye may differ visibly in size; the upper ommatidia tend to be larger. In the case of some Ephemeroptera the effect is so exaggerated that the upper part of the eye is elevated like a risen cupcake, while its lower part  that serves for routine vision looks like a separate organ. Compound eyes are often not completely symmetrical in terms of ommatidia count. For example, asymmetries have been indicated in honeybees and various flies. This asymmetry has been correlated with behavioural lateralization in ants (turning bias). Genetic controls. The head patterning is controlled by "orthodenticle", a homeobox gene which demarcates the segments from the top-middle of the head to the more lateral aspects. The ocelli are in an orthodenticle-rich area, and the gene is not expressed by the time one gets as lateral as the compound eyes. The gene  dachshund is involved in the development of the compound eye. Different opsins are used in the ocelli of compound eyes. Evolution. Hexapods are currently thought to fall within the Crustacean crown group; while molecular work paved the way for this association, their eye morphology and development is also markedly similar. The eyes are strikingly different from the myriapods, which were traditionally considered to be a sister group to the Hexapoda. Both ocelli and compound eyes were probably present in the last common arthropod ancestor, and may be apomorphic with ocelli in other phyla, such as the annelids. Median ocelli are  present in chelicerates and mandibulates; lateral ocelli are also present in chelicerates. Origin. No fossil organisms have been identified as similar to the last common ancestor of arthropods; hence the eyes possessed by the first arthropod remains a matter of conjecture. The largest clue into their appearance comes from the onychophorans: a stem group lineage that diverged soon before the first true arthropods. The eyes of these creatures are attached to the brain using nerves which enter into the centre of the brain, and there is only one area of the brain devoted to vision. This is similar to the  wiring of the median ocelli (small simple eyes) possessed by many arthropods; the eyes also follow a similar pathway through the early development of organisms. This suggests that onychophoran eyes are derived from simple ocelli, and the absence of other eye structures implies that the ancestral arthropod lacked compound eyes, and only used median ocelli to sense light and dark. However, a conflicting view notes that compound eyes appeared in many early arthropods, including the trilobites and eurypterids, suggesting that the compound eye may have developed after the onychophoran and arthropod lineages split, but before the radiation of arthropods. This  view is supported if a stem-arthropod position is supported for compound-eye bearing Cambrian organisms such as the Anomalocaridids. An alternative, however, is that compound eyes evolved multiple times among the arthropods. There were probably only a single pair of ocelli in the arthropod concestor; Cambrian lobopod fossils display a single pair, and while many arthropods today have three, four, or even six, the lack of a common pathway suggests that a pair is the most probable ancestral state. The crustaceans and insects mainly have three ocelli, suggesting that such a formation was present in "their" concestor. It is  deemed probable that the compound eye arose as a result of the 'duplication' of individual ocelli. In turn, the dispersal of compound eyes seems to have created large networks of seemingly independent eyes in some arthropods, such as the larvae of certain insects. In some other insects and myriapods, lateral ocelli appear to have arisen by the reduction of lateral compound eyes. Trilobite eyes. The eyes of trilobites came in three forms. The holochroal eye, the most common and most primitive, consisted of many small lenses, between 100-15000, covered by a single corneal membrane. This was the most ancient  kind of eye. This eye morphology was found in the Cambrian trilobites (the earliest) and survived until the Permian extinction. The more complex "schizochroal eye" was found only in one sub-order of trilobite, the Phacopina (Ordovician-Silurian). It has no modern counterpart, but adult male insects in the order Strepsiptera exhibit a similar structure. The eye has up to 700 larger lenses with individual sclera separating each lens. Each lens has a cornea. Schizochroal eyes developed from holochroal ones and were more powerful with overlapping visual fields. They were particularly useful for nocturnal vision and possibly for colour and  depth analysis. The lenses of the eye were constructed from single calcite crystals. Early schizochroal eye designs were rather haphazard and irregular, though constrained by the geometrical requirements of packing identical sized lenses on a curved surface. Later forms had graduating lens sizes. The third eye morphology of trilobites, called the abathochroal, was found only within the Eodiscina. This morphology consisted of up to 70 much smaller lenses. The cornea separated each lens, and the sclera on each lens terminated on top of each cornea. The eye morphology of trilobites is useful for determining their mode of life, and can  function as palaeoenvironmental indicators. Horseshoe crab. The horseshoe crab has traditionally been used in investigations into the eye, because it has relatively large ommatidia with large nerve fibres (making them easy to experiment on). It also falls in the stem group of the chelicerates; its eyes are believed to represent the ancestral condition because they have changed so little over evolutionary time. Horseshoe crabs are often considered to be living fossils. Most other living chelicerates have lost their lateral compound eyes, evolving simple eyes in their place. Horseshoe crabs have two large compound eyes on the sides of its head . An additional simple eye is positioned at the rear of each of these structures. In addition to these obvious structures, it also has two smaller ocelli situated in the middle-front of its carapace, which may superficially be mistaken for nostrils. A further simple eye is located beneath these, on the underside of the carapace. A further pair of simple eyes are positioned just in front of the mouth. The simple eyes are probably important during the embryonic or larval stages of the organism, with the compound eyes and median ocelli becoming the dominant sight organs during adulthood. These ocelli  are less complex, and probably less derived, than those of the mandibulata. Unlike the trilobites', the compound eyes of horseshoe crabs are triangular in shape; they also have a generative region at their base, but this elongates with time. Hence the one ommatidium at the apex of the triangle was the original "eye" of the larval organism, with subsequent rows added as the organism grew. Insects and crustaceans. It is generally thought that insects are a clade within the Crustacea, and that the Crustacea are monophyletic. This is consistent with the observation that their eyes develop in a very similar  fashion. While most crustacean and some insect larvae possess only simple median eyes, such as the Bolwig's organ pit-eye of "Drosophila" and the naupliar eye of most crustaceans, several groups have larvae with simple or compound lateral eyes. The compound eyes of adults develop in a region of the head separate from the region in which the larval median eye develops. New ommatidia are added in semicircular rows at the rear of the eye; during the first phase of growth, this leads to individual ommatidia being square, but later in development they become hexagonal. The hexagonal pattern will  become visible only when the carapace of the stage with square eyes is molted. Although stalked eyes on peduncles occur in some species of crustaceans and some insects, only some of the Crustacea, such as crabs, bear their eyes on articulated peduncles that permit the eyes to be folded out of the way of trouble. Myriapods. Most myriapods bear stemmata – single lensed eyes which are thought to have evolved by the reduction of a compound eye. However, members of the chilopod genus "Scutigera" have a compound eye, which is composed of facets and not, as earlier interpretations had it, of  clustered stemmata. that were thought to grow in rows, inserted between existing rows of ocelli.