  We introduce a new technique for following the formation and evolution of
galaxies in cosmological N-body simulations. Dissipationless simulations are
used to track the formation and merging of dark matter halos as a function of
redshift. Simple prescriptions, taken directly from semi-analytic models of
galaxy formation, are adopted for cooling, star formation, supernova feedback
and the merging of galaxies within the halos. This scheme enables us to study
the clustering properties of galaxies and to investigate how selection by type,
colour or luminosity influences the results. In this paper, we study properties
of the galaxy distribution at z=0. These include luminosity functions, colours,
correlation functions, pairwise peculiar velocities, cluster M/L ratios and
star formation rates. We focus on two variants of a CDM cosmology: a high-
density model with Gamma=0.21 (TCDM) and a low-density model with Omega=0.3 and
Lambda=0.7 (LCDM). Both are normalized to reproduce the I-band Tully-Fisher
relation near a circular velocity of 220 km/s. Our results depend strongly both
on this normalization and on the prescriptions for star formation and feedback.
Very different assumptions are required to obtain an acceptable model in the
two cases. For TCDM, efficient feedback is required to suppress the growth of
galaxies low-mass field halos. Without it, there are too many galaxies and the
correlation function turns over below 1 Mpc. For LCDM, feedback must be weak,
otherwise too few L* galaxies are produced and the correlation function is too
steep. Given the uncertainties in modelling some of the key physical processes,
we conclude that it is not yet possible to draw conclusions about the values of
cosmological parameters from studies of this kind. Further work on global star
formation and feedback effects is required to narrow the range of possibilities
