var vp_d = 10;
var roz_d = 1;
var roz_val1_d = 9999;
var roz_val2_d = 9999;
var cor_d = 5;
var tim_d = 3;
var out_name = "unnamed_csv_output";
function changeView(p1, p2, p3, o1, o2, o3, o4) {
var cam = document.getElementById('aView');
cam.setAttribute('position', p1+' '+p2+' '+p3);
cam.setAttribute('orientation', o1+' '+o2+' '+o3+' '+o4);
}
function handleFilesEye(file) {
if (window.FileReader) {
getAsText(file[0]);
out_name = file[0].name.substring(0, (file[0].name.length-4))+"_csv_output";
}
else {
window.alert('FileReader are not supported in this browser.');
}
}
function getAsText(fileToRead) {
var reader = new FileReader();
reader.readAsText(fileToRead);
reader.onload = loadHandler;
reader.onerror = errorHandler;
}
function loadHandler(event) {
var csv = event.target.result;
processData(csv);
}
function processData(csv) {
var allTextLines = csv.split(/\r\n|\n/);
var lines = [];
for (var k=0; k0)&&(coordinates[cor+1]>0))) {
document.getElementById('viewCursor').setAttribute('style', 'position: absolute; left:'+coordinates[cor]+'px; top: '+coordinates[cor+1]+'px;');
var hitpoint = el_x3dom.runtime.shootRay(coordinates[cor], coordinates[cor+1]);
if (hitpoint.pickObject) {
output.push([coordinates[tim], hitpoint.pickPosition.x, (hitpoint.pickPosition.z*(-1)), hitpoint.pickPosition.y, hitpoint.pickObject.getAttribute("DEF")]);
}
else {
output.push([coordinates[tim], 0, 0, 0, "Hitpoint is not defined", ""]);
}
}
else if ((coordinates[cor]>0)&&(coordinates[cor+1]>0)){
output.push([coordinates[tim], 0, 0, 0, "Out of screen", ""]);
document.getElementById('viewCursor').setAttribute('style', 'position: absolute; left: -20px; top: -20px;');
}
}, time)
}
for (var j=0; j