summaryrefslogtreecommitdiffstats
path: root/Smoke/report/chapter3.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Smoke/report/chapter3.tex')
-rw-r--r--Smoke/report/chapter3.tex39
1 files changed, 31 insertions, 8 deletions
diff --git a/Smoke/report/chapter3.tex b/Smoke/report/chapter3.tex
index 4f29bea..5be90ac 100644
--- a/Smoke/report/chapter3.tex
+++ b/Smoke/report/chapter3.tex
@@ -4,8 +4,9 @@ In chapter 2 we saw a figure (figure 2) which showed a fluid in motion. The flui
\section{Description}
-The technique that maps a value to a specific color is called color mapping. We already explained that the simulation is divided into a two dimensional array of
-different values. A colormap calculates the color, given a certain colormap function, for every value at a vertex. Example: \\
+The technique that maps a value to a specific color is called color mapping. We already explained that the simulation is divided into cells with each 4 vertices
+that can contain different values (a uniform quad grid). A colormap calculates the color, given a certain colormap function, for every value at a vertex. Example:
+\\
In figure 2 we saw the smoke using a grey scaled colormap. If we know that the values at the vertices ranges from 0 to 1, we can use the value to determine each
color aspect, red, green and blue. This means, for each vertex:
@@ -20,13 +21,35 @@ see big bands of colors appear. This way, the line between certain values become
\section{Implementation}
-We implemented a number of colormaps.
+We've implemented two actual colormaps and three which only contain one RGB color, red, green or blue (useful for isolines for instance). The "Wilrik" colormap
+implements a fire elemental color scheme. The other one is called "Oliver" and is a repeated band of colors which can show quite well where the fluid's in motion.
+\\
+
+\begin {center}
+ \includegraphics[width=100mm]{wilrik.png} \\
+ Figure 3: A fire colormap \\
+\end {center}
+
+The fire color is determined as follows:
+
+$$ red = value; green = value / 3; blue = 0; $$
+
+So, if the value is high, a lot of red, one third of green and no blue is taken. Low values only get a bit of red and almost no green. This gives a black to dark
+red to orange, almost yellow colormap. \\
+
+To create a repeating band of colors, we used to following definition:
+
+$$ value = (int)(value * 100) \texttt{ mod } 10 $$
+
+So we first multiply the value with 100, cast it to an integer and take that value modulo 10. We then take some colors from a look-up-table to pick the color for
+the band. \\
\section{Difficulties}
-The last mechanisms to implement for this assignment were scaling and clamping. With clamping you let the user set a minimum and maximum for the values. Actual data
-higher than the maximum or lower to the minimum are clamped to the maximum or minimum respectively. \\
+The last mechanisms to implement for this assignment were scaling and clamping. With clamping you let the user set a minimum and maximum for the values. This is
+done by first enabling clamping and then click somewhere in the bottom of the color legend and drag the minimum and maximum clamping indictors. Actual data lower
+then the minimum or higher than the maximum are set to the maximum or minimum respectively. \\
-The clamping mechanism was a bit more subtle. At every frame, the minimum and maximum values are stored and the entire dataset at the current time moment is mapped
-to the visible colormap. This is not so hard to do, but we had not foreseen that values could also be negative. It wasn't until we implemented the divergence that
-we found this problem. \\
+The (auto)scaling mechanism was a bit more subtle. When enabled, you can set the scaling in the same way as the clamping. For the auto-scaling, the minimum and
+maximum values are stored and the entire dataset at the current time moment is mapped to the visible colormap. This is not so hard to do, but we had not foreseen
+that values could also be negative. It wasn't until we implemented the divergence that we found this problem. \\