summaryrefslogtreecommitdiffstats
path: root/Smoke/report/chapter2.tex
blob: b4afc0a6a4c608fe6daa92a91c495e9d97961647 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\chapter{The skeleton code}

The provided code for the course contains an implementation of a real-time fluid flow simulation. The fluid flows under the influence of a user-controlled force
field. The simulation follows the Navier-Stokes equations for fluid flow. These equations describe how the velocity, pressure, temperature and density of a moving
fluid are related. \\

\section{Grid-based smoke}

The visualization is done using a two dimensional grid as opposed to particle-based smoke visualization techniques. At every vertex a number of fluid attributes are
stored. The skeleton program keeps track of the density, velocity and force. These attributes can be visualized with different techniques. Each and every
attribute has its own 'preferred' visualization technique. \\

Using these values at the cell's vertices, all sorts of techniques, additional values and other useful info can be used. The values are used in colormap techniques,
calculation of the divergence and the rendering of the height plots. \\

\begin {center}
  \includegraphics[width=70mm]{flow_vis.png} \\
  Figure 2: Fluid visualization \\
\end {center}

The above screenshot shows us the fluid movement using a grey colormap. This simple yet effective visualization technique is explained in chapter 3. \\

\section{Internal structure}

The first assignment was to simply compile the code. That was fairly easy. However, the code was a bit unstructured. Everything was put into one big file. To be
able to add additional functionality without losing sight of what we were doing, we created a file for every new technique we implemented. The second thing we
did is we split up the calculations, the rendering functions and user interactions from each other. \\

With this new structure we were able to manage the code and add additional functionality. We chose C as our programming language and used the GTK+ library to create
the graphical user interface. We also used SVN to manage our project. This was very useful since we both had different development environments and also did a lot
of work at home. \\