"Fossies" - the Fresh Open Source Software Archive

Member "wdune-0.99pl1551.orig/docs/interactive_open_wonderland_examples/planesensor_slider.x3dv" (17 Apr 2019, 1493 Bytes) of package /linux/privat/wdune_0.99pl1551.orig.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #X3D V3.0 utf8
    2 PROFILE Immersive
    3 
    4 DEF Transform1 Transform
    5   {
    6   children 
    7     [
    8     Shape
    9       {
   10       appearance Appearance
   11 	{
   12 	material Material
   13 	  {
   14 	  diffuseColor 1 1.56862754e-2 1.56862754e-2
   15 	  }
   16 	}
   17       geometry Box
   18 	{
   19 	size 0.30000001 0.30000001 0.30000001
   20 	}
   21       }
   22     DEF PlaneSensor1 PlaneSensor
   23       {
   24       }
   25     ]
   26   }
   27 
   28 DEF Script1 Script 
   29   {
   30   inputOnly SFVec3f vec3f1_in
   31   outputOnly SFVec3f vec3f1_out
   32   outputOnly MFString mstring1_out
   33   url 
   34     [
   35     "javascript:
   36 
   37 // insert program code only into functions
   38 
   39  // eventOut SFVec3f vec3f1_out //
   40 
   41  // eventOut MFString mstring1_out //
   42 
   43  function vec3f1_in(value)
   44     {
   45     // value  SFVec3f
   46     x = value[0];
   47     if (x > 1)
   48         x = 1;
   49     if (x < -1)
   50         x = -1;
   51     vec3f1_out = new SFVec3f(x, 0, 0);
   52     mstring1_out = new MFString(x);
   53     }
   54 "
   55     "java:
   56     X3dScript_Script1 script = (X3dScript_Script1)node;
   57     float x = script.vec3f1_in[0];
   58     if (x > 1)
   59         x = 1;
   60     if (x < -1)
   61         x = -1;
   62      script.vec3f1_out[0] = x;
   63      script.mstring1_out = new String[1];
   64      script.mstring1_out[0] = \"\" + x;
   65 "
   66     ]
   67   }
   68 
   69 ROUTE PlaneSensor1.trackPoint_changed TO Script1.vec3f1_in
   70 ROUTE Script1.vec3f1_out TO Transform1.set_translation
   71 
   72 Transform
   73   {
   74   translation -1.05623161 -1.76739084 0
   75   children 
   76     Shape
   77       {
   78       appearance Appearance
   79 	{
   80 	material Material
   81 	  {
   82 	  }
   83 	}
   84       geometry DEF Text1 Text
   85 	{
   86 	string "test"
   87 	}
   88       }
   89   }
   90 
   91 ROUTE Script1.mstring1_out TO Text1.set_string
   92