Starting from:

$30

Scientific Visualization  Machine Problem 1

CS 519 Scientific Visualization 
Machine Problem 1:
Programming Language and Tools 
For this MP, use HTML5 and JavaScript. If you wish, you can use WebGL, although you can 
accomplish the MPs just using the HTML5 canvas element as you have done in class.  
Marching Squares 
You will implement marching squares to draw 2D contour lines. The algorithm is described in 
section 5.3.1 of Data Visualization: Principles and Practice by Telea. You can also refer to the 
Wikipedia article (http://en.wikipedia.org/wiki/Marching_squares).  
Implementation Requirements: 
1. Your user interface should support the specification of an arbitrary number of contour
values. You could use a text box to allow the user to type in a list of values, for example. 
Similarly your code should support the creation of multiple contour lines. 
2. You should resolve the ambiguous case for marching squares by averaging the function
values at the corners of the square to generate a sample in the square center as shown
1
3. In addition to rendering the contour lines, your code should display the function across
the domain using the rainbow color map. In the interest of saving you time, you don’t
need to draw a legend depicting the mapping of color to values, although you would
obviously do so for professional work.
4. Implement another colormap that is neither greyscale nor rainbow. Design a colormap
with a clear break at the zero crossing.
1 "Marching­squares­isoline". Licensed under CC BY 3.0 via Wikipedia ­ 
http://en.wikipedia.org/wiki/File:Marching­squares­isoline.png#mediaviewer/File:Marching­squar
es­isoline.png 
5. Your code should work for the Gaussian function we have used in class, as well as the
function    which can be seen in Figure 2.3 of  sin (
1 Data Visualization: Principles and x2 2 +y )
Practice by Telea
6. Your code should consist of the following files:
ScalarVis.html
ScalarVis.js
SciVisMath.js
UGrid2D.js
You may base your code off of startup code available on GitHub at
https://github.com/shaffer1/UIllinois_SciVis/tree/master/MP1
Grading 
The MP is worth 10% of your total course grade. It will be graded out of 10pts as follows: 
● 6 points: Correct Implementation of Marching Squares
● 2 points: Correct implementation of the new colormap
● 1 point: Providing a reasonable user interface
● 1 point: Implementing the function  ins (
1
x2 2 +y )
Submission 
Submission will be through Compass. You are required to submit the following: 
1. Your source code (all four files listed above).
2. An image demonstrating marching squares applied to the Gaussian function you
implemented in class with multiple contour lines.
3. An image demonstrating your new colormap applied to the new function you implement

More products