Modelling Galaxy Collisions in Maya
Martin Watt
Other images and animations
The aim of this project was to model the behaviour of two spiral
galaxies colliding using the dynamics tools in Maya. All
the interactions are modelled using only gravitational fields (no
animation paths are used.) The galaxies are modelled using particles
to represent stars. The dust between the stars (the cloudy looking
component in the images above) was modelled two ways, first using the
2d postprocess glow and halo shaderGlow attributes and second
modelling the dust as particles and rendering using 3d cloud render
types. The 2d postprocess looked better in stills but flickered during
animations, the 3d process eliminated the flicker but did not look so
good. The dynamics worked really well and gives very realistic looking
results. In particular, the way tendrils get torn off and trail behind
the galaxies in long loops is very nice.
Spiral galaxies
These are large (100 billion star) systems that are gravitationally
bound. Most stars lie in an extended disk about a central spherical
nucleus. The whole system rotates once every hundred million years or
so. Most of the mass in the galaxies is in the form of 'dark matter'
which is invisible and whose nature is unknown, but which will have a
large gravitational effect which needs to be taken into
account. Collisions between two such objects produce spectacular
results, and are well suited to computer modelling since the basic
gravitational interaction is straightforward to set up and simply
requires a lot of number crunching.
Model setup
Since only gravitational forces are allowed (no animation paths), the
stars need to be placed carefully with appropriate positions and
velocities to ensure they stay in orbit about the centre.
- Gravitational fields
Gravitational field are not attached to the individual stars for
reasons described below. Instead, two particle
objects are created corresponding to the nuclei of the two galaxies,
and the gravitational fields (scaled by the total number of stars) are
constrained to be coincident with these nuclei. These gravitational
fields are then connected to the two particle objects corresponding to
the stars in the two galaxies, and also connected to the nucleus
of the other galaxy.
The force of gravity is of course an inverse square force. However
in the case of a galaxy, the total gravitational field will fall off
more slowly than this since, as one moves away from the centre, more
and more stars have an influence on the total gravitational field of
the system. There is also a large amount of dark matter present too in
a roughly spherical halo about the centre, and the overall effect of
this is that the mass within radius r increases linearly with r, so
the gravitational field strength actually drops off in all directions
as 1/r rather than 1/r^2. Happily the Newton field node allows a
variable index to be set as the radial falloff, so this can be
modelled accurately.
- Positions
The stars are arranged in a rough spiral pattern about the centre of
the galaxy with a little random noise added in all three dimensions to
add realism.
- Orbital velocities
This is harder. To stay in orbit the velocity
has to be set so that the centrifugal and gravitational forces
balance. This means:
GMr/r2 = v2/r
or
v = (GMr) /r)1/2
where G is the gravitational constant (fixed to be 6.67E-1 in Maya), r
is the distance of the star from the centre and Mr is total
mass of the galaxy within the radius r, which is proportional to r (as
described above). This means the orbital velocity is independent of r.
Since there is a finite sized time step for the dynamics evaluations,
the orbits end up slightly elliptical rather than exactly
circular. However as long as the velocity is close to the `correct'
value, these orbits will be stable.
- Global motions
The whole galaxy can be given a global
velocity. In this case the nucleus, stars and field all move together
in the given direction, and the stars have both global and the orbital
components of velocity.
This means overall there are 4 particle objects (two for the two nuclei
and two for the two sets of stars) and two Newton fields (one
constrained to the position of each nucleus.) Each Newton field is
connected to the other 3 particle objects.
Simplifying assumptions
A full modelling job would run too slowly, so some assumptions were
made to make the process easier to manage:
Rendering
The particles representing the stars are rendered using the cloud
software render type. The particles representing the nuclei are also
cloud types but are given a larger size. The particles are made
incandescent, so all the light comes from the particles themselves
with no external light sources. To do the dust, two approaches were
used:
- glow and halo attributes on the shaderGlow node were set (by
trial and error) to represent the diffuse dust which is distributed
between the stars in the galaxy. With these attributes, the stills
look quite good - the clumpiness of the dust is well mimicked by these
simple attributes, but the animations are not quite so good. The
problem with animations is a result of the glow and halo attributes
being applied as a postprocess to the 2d image based on the brightness
of individual pixels. As the particles move, individual pixels in the
2d image fluctuate a lot in brightness, causing the diffuse component
to flicker rather a lot. High oversampling can overcome most of these
problems at the cost of greatly increased rendering time, but there is
still a component of flicker when one particle passes behind another,
since the 2d postprocess only considers the front particle. (Note that
this is the correct behaviour for the postprocess, and causes a
problem for the animations here because it is being used to try to
render something it is not really intended for.) Because of the
flickering, animations using the shaderGlow were set up with large
time steps, which tended to hide the effects of the flickering since
so much else changed between frames.
- The second approach was to create the dust using particles that
moved in 3d in the same way as the stars, but was rendered to provide
the diffuse appearance. The only suitable type seemed to be the cloud
type again, but the results were not as good as those obtained using
the 2d shaderGlow postprocess, since each individual cloud object has
a sharply defined boundary which did not fade out towards the edges so
naturally, although further tweaking might improve the appearance.
The main advantage of this approach was that the animations were
flicker-free.
Rendering was performed on a Silicon Graphics Octane workstation.
Results
Here are some complete animations and also some still images taken
from these animations. These animations are done with two equal sized
galaxies, each with either 729 or 2000 particles to represent the
stars. The galaxies are oriented at right angles to each other, one
galaxy is stationary, the other travels directly towards it. The
impact is offcentre rather than a core-core impact (which tends to
completely disintegrate both objects) The idea was to have a
noticeable interaction but still keep the two objects recognizable and
distinct afterwards. All of these initial conditions can be modified
to set up various scenarios with different levels of destruction.
Since the 2000 star galaxies are more massive, the degree of
interaction between the two galaxies is much greater for this case.
Links to external sites
Sites relate to modelling and producing animations of galaxy
collisions and some real astronomical images of galaxy collisions.
Simulations and animations
Simulation
from San Diego Supercomputer Center Biggest simulation to date -
run for 750 hours on a Cray C90 using 250000 stars per galaxy, full
N-body solution including collisions between dust clouds which
involves hydrodynamic forces etc etc. The results were used in an IMAX
film, `Cosmic Voyage' which has been
nominated for an academy award. Here are some stills
from the animation and a picture of the animation being
created .
Another IMAX colliding galaxies movie based on an older simulation
(1994) run on a Cray-2 using 25000 stars per galaxy. Wavefront
Technologies is acknowledged as being a software supplier.
Dynamics
of Galaxy Interactions - University of Hawaii Some nice MPEG
movies of different types of interactions, for example this
one
The
Cosmic Explorer Uses the CAVE environment to display the results
of cosmic simulations.
Real images
These were surprisingly hard to find. Here is one composite of a
ground-based
and Hubble Space Telescope image There is also a large and
extremely spectacular version of the image here