Created
June 6, 2013 10:03
-
-
Save cecilemuller/5720511 to your computer and use it in GitHub Desktop.
X3D: Multiple touchsensors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#X3D V3.0 utf8 | |
PROFILE Immersive | |
Viewpoint {} | |
Transform { | |
translation -2 0 0 | |
children [ | |
DEF touchsensor_1 TouchSensor {} | |
Shape { | |
appearance Appearance { | |
material Material {} | |
} | |
geometry Box{} | |
} | |
] | |
} | |
Transform { | |
translation 2 0 0 | |
children [ | |
DEF touchsensor_2 TouchSensor {} | |
Shape { | |
appearance Appearance { | |
material Material {} | |
} | |
geometry Sphere{} | |
} | |
] | |
} | |
DEF a_script Script { | |
eventIn SFTime obj_1_clicked | |
eventIn SFTime obj_2_clicked | |
directOutput TRUE | |
url "javascript: | |
function obj_1_clicked(){ | |
trace('The Box was clicked'); | |
} | |
function obj_2_clicked(){ | |
trace('The Sphere was clicked'); | |
} | |
" | |
} | |
ROUTE touchsensor_1.touchTime TO a_script.obj_1_clicked | |
ROUTE touchsensor_2.touchTime TO a_script.obj_2_clicked |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment