summaryrefslogtreecommitdiffstats
path: root/Smoke/report/chapter7.tex
diff options
context:
space:
mode:
authorWilrik de Loose <wilrik@wilrik.nl>2008-01-08 13:31:15 (GMT)
committerWilrik de Loose <wilrik@wilrik.nl>2008-01-08 13:31:15 (GMT)
commit0ce08ace350d6cc856304a428896c4477876159c (patch)
tree04733a0a2569ae5910446a48e4d59e64a087f512 /Smoke/report/chapter7.tex
parenta570135d7b6167a56f98ee392fea8dc943168fd5 (diff)
download2iv35-0ce08ace350d6cc856304a428896c4477876159c.zip
2iv35-0ce08ace350d6cc856304a428896c4477876159c.tar.gz
2iv35-0ce08ace350d6cc856304a428896c4477876159c.tar.bz2
+ verslag
Diffstat (limited to 'Smoke/report/chapter7.tex')
-rw-r--r--Smoke/report/chapter7.tex59
1 files changed, 59 insertions, 0 deletions
diff --git a/Smoke/report/chapter7.tex b/Smoke/report/chapter7.tex
new file mode 100644
index 0000000..a132675
--- /dev/null
+++ b/Smoke/report/chapter7.tex
@@ -0,0 +1,59 @@
+\chapter{Height plots}
+
+This chapter treats a very neat visualization technique, namely the height plots. What are height plots, what are they used for and how did we implement them? \\
+
+\section{Description}
+
+All the previous discussed methods are implemented on a 2D grid. But sometimes it's also useful to see the value not by it's color but by the height of the surface.
+This is exactly what a height plot does. It maps the values onto the Z-axis. This means that, initially, you won't see much differences between the version with and
+without the high plots implemented. This is because of the height that is being drawn onto the Z-axis that runs towards the screen. \\
+
+To make the height more visible, we implemented a method to rotate the field by dragging the mouse over the screen while holding the right mouse button. Then you
+will see the height of the field. \\
+
+\section{Implementation}
+
+First of all we implemented the method to rotate the field by mouse. Without this useful functionality, the height would'nt be that visible. After we implemented
+this feature we added the height to the program. \\
+
+We created the height by adding an extra Z-coordinate to each value. We created an extra array that would keep track of the height of each vertex. When drawing the
+vertex we use the stored height from the array and render the vertex using that value for the Z-coordinate. \\
+
+To see more depth in the picture we also included some ambient and diffuse light to the program. In order to let the light have effect on the surface we calculate
+the normal vector for each vertex. \\
+
+\subsection{Normal vector}
+
+For the calculation of the normal vector for a given vertex, say $ v_0 $, we first take the two neighboring vertices in that cell, $ v_{1} $ and $ v_{2} $. We take
+the difference of $ v_0 $ with $ v_1 $ and of $ v_1 $ with $ v_2 $. Then we take the cross product of these two differences and normalize the result. This gives us
+the normal vector at $ v_0 $. \\
+
+The OpenGL renderer uses this vector to calculate the angle between the normal and the light that is shining on the vertex. This angle is then used to shade a
+vertex and with that an entire surface. \\
+
+\section{Difficulties}
+
+We had some small issues during the implementation of this entire assignment but we managed to implement them correctly. \\
+
+\subsection{Rotation}
+
+The first problem we encountered was due to the rotation of the field. Rotating around one axis was not to difficult. When we tried to rotate the field around two
+or three axis', the simulation wasn't rotating around it's center any more.\\
+
+It turned out we were translating and rotating in the opposite order. When we changed the order of rotating and translating the simulation rotated around it's
+center. \\
+
+\subsection{Height strips}
+
+When we first tried to implement the height plots we simply added a third dimension when rendering the triangle strips for the smoke visualization. This had as an
+effect that the different rows of the simulation where'nt connected. In stead of a height plots we implemented height strips. \\
+
+We countered this problem by first calculation the height for each vertex and when rendering a vertex look up the correct value for the height. \\
+
+\subsection{Calculating the normal}
+
+When enabling the light in our program and adding the normal to each vertex we had some crazy outcome. This was because of the fact we did'nt consistently took the
+left and lower neighbor of a vertex to calculate the normal vector. As a result each vertex was randomly pointing up or downwards. This looked like some sort of
+checkers board. \\
+
+We rendered the normal vectors and immediately saw the cause of the problem. It was simply solved by always taking the right neighbor vertices. \\