Commit a00b4ee1 authored by amandaghassaei's avatar amandaghassaei

added url label

parent e6efc242
......@@ -10,8 +10,7 @@ function initViveInterface(globals){
if ( WEBVR.isAvailable() === false ) {
$status.html("WebVR not supported by this browser<br/>see <a href='https://webvr.info/' target='_blank'>webvr.info</a> for more information.");
$("#VRoptions").hide();
// return;
// todo put this back!!
return;
}
$status.html("No device connected.");
......@@ -96,12 +95,12 @@ function initViveInterface(globals){
gui.add(variables.position, "y").min(-positionBound).max(positionBound).step(0.01).name("Position Z").onChange(positionCallback);
var examplesMenu = dat.GUIVR.create( 'Examples' );
var examplesMenu = dat.GUIVR.create( 'Examples');
examplesMenu.position.set(1.1, 2.3, -0.1);
examplesMenu.rotation.set(0, -Math.PI / 2, 0);
scene.add( examplesMenu );
// examplesMenu.visible = false;
dat.GUIVR.enableMouse(camera);
examplesMenu.visible = false;
// dat.GUIVR.enableMouse(camera);
var examples = {
Origami: {
......@@ -179,6 +178,7 @@ function initViveInterface(globals){
globals.vertTol = 3;
globals.importer.importDemoFile(url);
}
examplesMenu.name("Examples, current file: " + val);
});
});
......@@ -275,6 +275,8 @@ function initViveInterface(globals){
renderer.vr.setDevice( display );
renderer.vr.standing = true;
globals.threeView.setBackgroundColor("000000");
var filename = getCurrentFileName();
examplesMenu.name("Examples" + filename);
} else {
globals.numSteps = 100;
$(".numStepsPerRender").val(globals.numSteps);
......@@ -408,6 +410,19 @@ function initViveInterface(globals){
return position;
}
function getCurrentFileName(){
console.log(globals.url);
if (globals.url === null) return "";
var keys = _.keys(examples);
for (var i=0;i<keys.length;i++){
var group = examples[keys[i]];
if (group[globals.url]){
return ", current file: " + group[globals.url];
}
}
return "";
}
return {
render: render
}
......
......@@ -39,6 +39,8 @@ function initGlobals(){
menusVisible: true,
url: null,
//3d vis
simType: "dynamic",
......
......@@ -14,6 +14,7 @@ function initImporter(globals){
extension = extension[extension.length-1];
// globals.setCreasePercent(0);
if (extension == "svg"){
globals.url = url;
globals.filename = name;
globals.extension = extension;
globals.pattern.loadSVG("assets/" + url);
......@@ -49,6 +50,7 @@ function initImporter(globals){
$('#doSVGImport').unbind("click");
globals.filename = name;
globals.extension = extension;
globals.url = null;
globals.pattern.loadSVG(reader.result);
});
}
......@@ -63,6 +65,7 @@ function initImporter(globals){
}
globals.filename = name;
globals.extension = extension;
globals.url = null;
try {
var fold = JSON.parse(reader.result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment