$25
Please read steps (4) and (5) closely … they are dense and have a lot of instructions.
If you miss part of their meaning, you will likely get the wrong answer.
Assignment:
1) Download skeleton file proj3.cxx and file data_proj3.vtk and put them in a
new directory.
a. proj3.cxx has an empty implementation for EvaluateFieldAtLocation
… copy your implementation from proj2.
2) Re-use your CMakeLists.txt from the last project … copy it to the new
directory and rename as appropriate to reflect proj3.
3) Run cmake, compile the program and run the program. It will generate
incorrect output. It generates three outputs … “bluehot.png”,
“difference.png”, and “hsv.png”. If you open them, they will be all black.
4) Look for the comment with “ITERATE OVER PIXELS”. You need to
implement code here. Your code should map the physical space X=-9à9,
Y=-9à9 to an image of size nx by ny. Specifically, map i==0, j==0 to X=-9,
Y=-9 and i==nx-1, j==ny-1 to X=+9, Y=+9. Each of the nx times ny pixels will
get mapped to a two-dimensional location. Once you know that twodimensional location, interpolate the field to that location. Once you have
done that, the pre-existing code (“I TAKE OVER HERE”) will call a function to
map the field value to a scalar.
5) Implement the following functions (all functions defined in function
header in the source code):
a. ApplyBlueHotColorMap
b. ApplyDifferenceColorMap
c. ApplyHSVColorMap
Note that the scalar field has a minimum value of 1.2 and a maximum
value of 5.02. You should take this into account when you do your
color mapping. For example, field values of 3.11 (= 50% of the way
between 1.2 and 5.02) should be mapped to the middle of the color
map.
6) Upload your source code when it is working. Make sure to cross-reference
with the correct images posted on the website using the differencer. (I
expect the images to be correct, and expect less than half credit if it is not.