SciVis 2017 Project 4: "vectr"

Assigned Mon Feb 20; Due Wed March 2 at 11:59pm

For this project, you will implement 2-D vector field convolution, streamline integration, and Line Integral Convolution (LIC). This is a shorter and simpler project than others; the reference implementation has only about 250 lines inserted into the give code. Also, detailed instructions are included in lic.c for doing the LIC.


Your CNETID-scivis-2017 directory should now be populated with a p4vectr directory which contains all the files for this project. All other aspects of logistics are similar to previous projects: make in p4vectr should make vectr executable, which you will compare with reference executable rvectr. Work individually or in pairs.

One small novelty (based on feedback at the previous lab) is that if you want to compile your code without the -O2 optimization, you can set something else:

export DASHO=-O0
make clean; make
Compiling without optimization may produce an executable that is easier to debug.

Like in Project 3, there is a vcrVerbose global variable that you should use to control the printing of any debugging messages. vcrVerbose is set from the value of environment variable VCR_VERBOSE by the vectr as soon as it starts. Grading will be done with VCR_VERBOSE unset.

What to do

Run "./rvectr" to review the commands available, and run "./rvectr about" to see what needs to be implemented. The convolution code (for vcrConvoEval) will be nearly identical to what was done for Project 2: we again need 2-D convolution, but now in a vector field rather than a scalar image. Reading through and understanding the header file vcr.h is essential. The vcrMath.h macro collection will be familiar.

The handling of these lines

/* v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v  begin student code */
/* ^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^'^  end student code */
is the same as in previous assignments. There are detailed notes in the comments preceeding these blocks detailing what has to be done.

33710 students have two additional things to implement:

  1. Runge-Kutta Fourth-order integration along streamlines: the "-iintg rk4" option for "vectr sline" and "vectr lic", which determines the value of the intg variable passed to vcrSlineTrace() and vcrLIC, respectively.
  2. In vcrLIC, if the rndLinterp argument is nonzero, do bilinear interpolation into the given noise texture, instead of nearest-neighbor interplation.

Example vectr/rvectr commands to try

The commands here use "./rrendr"; you should make sure that you get the exactly same results by running "./rendr". To an unfortunate extent the commands are intended to be executed in the order shown: later commands assume the presence of files created by running earlier commands.


The grade will be based on style (10%) and correctness (90%), similar to previous projects. The style points will be the same as for Project 2: new functions are "static", convolution uses 2*S not S^2 kernel evaluations, the code compiles without warnings, and there are no memory leaks (though how this is tested may be more rigorous than it was for Project 2). The correctness points will be based on the commands above or some slight modifications.