/**
* Object describing a seed line.
* @class
* @param {THREE.Vector3} start The starting point of the seed line.
* @param {THREE.Vector3} end The end point of the seed line.
* @param {float} interval The interval, in which the seed points should be sampled.
*/
function SeedLine(start, end, interval) {
/** The starting point of the seed line. */
this.start = start;
/** The end point of the seed line. */
this.end = end;
/** The interval, in which the seed points should be sampled. */
this.interval = interval;
}
/**
* This function generates a volume, calls the calculation of a surface, sets up the
* renderer and initializes the GUI.
*/
function run() {
var vol = new Volume(100,100,100);
//vol.generateTornado(100);
vol.generateTest1();
var seedLine = new SeedLine(
new THREE.Vector3(0.7,0.5,0.8),
new THREE.Vector3(0.7,0.5,0.2),
0.01
);
var numIt = 100;
var surface = new StreamSurface();
surface.calculate(vol, seedLine, numIt);
var canvas = document.getElementById("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var ren = new Rendering(canvas);
ren.init(surface, seedLine);
ren.render();
ren.animate();
initGUI(seedLine, vol, surface, ren, numIt);
}