DEF Welder Script {
directOutput TRUE
exposedField SFBool initialized FALSE
exposedField SFBool allowGest TRUE
exposedField SFInt32 id 0
exposedField SFInt32 code 0
eventOut SFBool bye
eventIn SFBool Watched
eventIn SFFloat fooEvents
eventIn SFTime G0 IS set_gesture1
eventIn SFTime G1 IS set_gesture2
eventIn SFTime G2 IS set_gesture3
eventIn SFTime G3 IS set_gesture4
eventIn SFTime G4 IS set_gesture5
eventIn SFTime G5 IS set_gesture6
eventIn SFTime G6
eventIn SFTime G7 IS set_gesture8
eventIn SFTime G8
eventIn SFTime G9
field SFBool sitting FALSE
eventIn SFTime Touch
eventIn SFBool Gend
eventIn SFVec3f P1
eventIn SFRotation rot_Center
eventIn SFVec3f P2
eventIn SFRotation rot_sacroiliac
eventIn SFRotation rot_vl5
eventIn SFRotation rot_vc7
eventIn SFRotation rot_neck
eventIn SFRotation rot_skull
eventIn SFRotation rot_r_shoulder
eventIn SFRotation rot_r_shoulder2
eventIn SFRotation rot_r_elbow
eventIn SFRotation rot_r_wrist
eventIn SFRotation rot_falang_d
eventIn SFRotation rot_r_elbow2
eventIn SFRotation rot_l_shoulder
eventIn SFRotation rot_l_shoulder2
eventIn SFRotation rot_l_elbow
eventIn SFRotation rot_l_wrist
eventIn SFRotation rot_l_elbow2
eventIn SFRotation rot_cul_d
eventIn SFRotation rot_r_hip
eventIn SFRotation rot_r_buttok
eventIn SFRotation rot_r_knee
eventIn SFRotation rot_r_ankle
eventIn SFRotation rot_orteil_d
eventIn SFRotation rot_r_knee2
eventIn SFRotation rot_l_hip
eventIn SFRotation rot_l_buttok
eventIn SFRotation rot_l_knee
eventIn SFRotation rot_l_ankle
eventIn SFRotation rot_orteil_g
eventIn SFRotation rot_l_knee2
eventIn SFRotation rot_pubis
field SFNode Vtx USE PointList
field MFVec3f W []
field MFVec3f V []
field SFVec3f Pc -0.0389 1.0534 0.0890
field MFVec3f P [
0 -1.7400 0,
-0.0389 1.0534 0.0890
-0.0051 0.1119 -0.0938
-0.0004 -0.0021 -0.0019
0.0004 0.0514 -0.0019
-0.1031 0.1004 0.0303
0.1054 0.1004 0.0272
-0.0004 0.3385 -0.0387
-0.0006 0.0338 0.0072
0.0001 0.0483 0.0692
-0.0000 -0.0201 -0.0314
0.0374 0.0492 0.0248
-0.0362 0.0497 0.0255
-0.0002 0.0411 -0.0355
-0.0006 -0.0472 -0.0055
0.0011 -0.0181 0.0439
0.0009 -0.0299 0.0306
0.0011 0.0234 0.0229
0.0000 0.0273 0.0048
0.0001 0.1439 0.0109
0.0699 0.0507 -0.0044
-0.0696 0.0971 0.0202
-0.0725 0.0507 -0.0044
-0.1885 0.2345 -0.0233
-0.0045 0.0252 0.0106
-0.2209 0.0035 -0.0029
-0.2341 0.0162 0.0226
-0.0574 0.0424 0.0002
-0.0845 -0.0100 -0.0085
-0.0000 0.0069 -0.0017
0.1915 0.2345 -0.0275
0.0016 0.0252 0.0119
0.2217 0.0237 -0.0007
0.2320 -0.0062 0.0226
0.0566 0.0411 0.0026
0.0822 -0.0089 -0.0096
0.0501 -0.0081 -0.0264
-0.0026 -0.0136 -0.0047
0.1910 -0.0133 0.0003
-0.0977 -0.1407 -0.0611
-0.0144 0.0205 0.0601
0.0014 0.0053 0.0005
0.0142 -0.0469 -0.0584
0.0153 -0.4194 -0.0389
-0.0006 -0.4848 -0.0100
0.0015 -0.0467 0.0841
0.0042 -0.0011 0.0062
-0.0000 0.0068 0.0151
-0.0046 -0.2440 -0.0168
0.0234 -0.2055 -0.0123
0.0991 -0.1400 -0.0611
0.0084 0.0214 0.0619
0.0027 0.0091 -0.0029
-0.0130 -0.0529 -0.0568
-0.0109 -0.4202 -0.0364
0.0001 -0.4910 -0.0155
-0.0010 -0.0415 0.0834
-0.0042 0.0000 0.0000
-0.0121 0.0039 0.0173
0.0008 -0.2463 -0.0179
-0.0166 -0.2067 -0.0131
0.0000 -0.1449 -0.0214
-0.0007 -0.0345 0.0269
]#pivots
field MFRotation R0 [
0.0000 1.0000 0.0000 0.0000,
0.4622 0.6059 0.6475 -0.0961,
0.0000 1.0000 0.0000 0.0000,
0.5753 0.8141 -0.0791 -0.1392,
-0.6329 0.3869 -0.6706 -0.1008,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
-0.8660 -0.3383 0.3681 -0.1141,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
-0.1743 0.0636 -0.9826 -1.2180,
0.1743 -0.0636 0.9826 -0.6090,
-0.0281 -0.9686 -0.2472 -0.4895,
-0.9897 -0.0598 0.1304 -1.5189,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0281 0.9686 0.2472 -0.2448,
-0.1384 -0.0014 0.9904 -1.2360,
0.1384 0.0014 -0.9904 -0.6180,
-0.0357 0.9456 0.3235 -0.4864,
-0.9915 0.0481 -0.1207 -1.5286,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0357 -0.9456 -0.3235 -0.2432,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
-0.1471 0.9869 0.0659 -0.4220,
0.1471 -0.9869 -0.0659 -0.2110,
0.0000 1.0000 0.0000 0.0000,
-1.0000 0.0000 0.0000 -0.2918,
0.9234 -0.1310 0.3608 -0.2864,
0.0000 1.0000 0.0000 0.0000,
1.0000 0.0000 0.0000 -0.1459,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.7638 0.0153 -0.6453 -0.2761,
-0.7638 -0.0153 0.6453 -0.1380,
0.0000 1.0000 0.0000 0.0000,
-1.0000 0.0000 0.0000 -0.4317,
0.3513 -0.8296 0.4341 -0.2908,
0.0000 1.0000 0.0000 0.0000,
1.0000 0.0000 0.0000 -0.2159,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.0000 1.0000 0.0000 0.0000,
0.4746 0.8698 -0.1352 -0.2366,
]#rotations
field MFRotation R[]
field MFInt32 vgroups[
0 0 0 #dummy
1 0 0 #dummy
2 0 30
3 30 80
4 80 150
5 150 171
5 171 192
5 192 211
6 0 0 #dummy
7 211 296
8 296 339
9 339 368
9 368 397
9 397 438
8 438 479
9 0 0 #dummy
8 0 0 #dummy
8 0 0 #dummy
7 479 482
8 0 0 #dummy
7 482 491
8 0 0 #dummy
7 491 500
5 500 525
6 525 534
6 534 554
7 554 578
8 578 591
8 591 643
7 643 653
5 653 678
6 678 687
6 687 707
7 707 731
8 731 744
8 744 796
8 0 0 #dummy
7 796 806
7 0 0 #dummy
3 0 0 #dummy
4 806 849
5 849 870
6 0 0 #dummy
5 870 901
6 901 921
7 921 927
6 927 935
7 0 0 #dummy
6 0 0 #dummy
5 0 0 #dummy
3 0 0 #dummy
4 935 978
5 978 994
6 0 0 #dummy
5 994 1025
6 1025 1045
7 1045 1051
6 1051 1059
7 0 0 #dummy
6 0 0 #dummy
5 0 0 #dummy
3 0 0 #dummy
4 1059 1063
]
exposedField MFString mbrNames [
"dummy_sol",
"Center",
"sacroiliac",
"vl5",
"vc7",
"sein_d",
"sein_g",
"neck",
"skull",
"Nez",
"pomettes",
"oeil_g",
"oeil_d",
"Cheveux",
"menton",
"barbe",
"moustache",
"lunette",
"distance",
"chapo",
"Oreille_g",
"boucles",
"Oreille_d",
"r_shoulder",
"r_shoulder2",
"r_elbow",
"r_wrist",
"pouce_d",
"falang_d",
"r_elbow2",
"l_shoulder",
"l_shoulder2",
"l_elbow",
"l_wrist",
"pouce_g",
"falang_g",
"sac",
"l_elbow2",
"bracelet",
"cul_d",
"r_hip",
"r_buttok",
"fes_d",
"r_knee",
"r_ankle",
"orteil_d",
"r_knee2",
"genu_d",
"jambo_d",
"cui_d",
"cul_g",
"l_hip",
"l_buttok",
"fes_g",
"l_knee",
"l_ankle",
"orteil_g",
"l_knee2",
"genu_g",
"jambo_g",
"cui_g",
"basine",
"pubis",
]#mbrNames
field SFInt32 mode 0
field SFBool watched TRUE
field SFInt32 currG -1
field SFInt32 nextG -1
field MFNode ts[USE TS1,USE TS2,USE TS3,USE TS4,USE TS5,USE TS6,USE TS7,USE TS8,USE TS9,USE TS10,]
url "javascript:
function P1(p){P[1]=p;}
function rot_Center(r){R[1]=r;}
function P2(p){P[2]=p;}
function rot_sacroiliac(r){R[2]=r;}
function rot_vl5(r){R[3]=r;}
function rot_vc7(r){R[4]=r;}
function rot_neck(r){R[7]=r;}
function rot_skull(r){R[8]=r;}
function rot_r_shoulder(r){R[23]=r;}
function rot_r_shoulder2(r){R[24]=r;}
function rot_r_elbow(r){R[25]=r;}
function rot_r_wrist(r){R[26]=r;}
function rot_falang_d(r){R[28]=r;}
function rot_r_elbow2(r){R[29]=r;}
function rot_l_shoulder(r){R[30]=r;}
function rot_l_shoulder2(r){R[31]=r;}
function rot_l_elbow(r){R[32]=r;}
function rot_l_wrist(r){R[33]=r;}
function rot_l_elbow2(r){R[37]=r;}
function rot_cul_d(r){R[39]=r;}
function rot_r_hip(r){R[40]=r;}
function rot_r_buttok(r){R[41]=r;}
function rot_r_knee(r){R[43]=r;}
function rot_r_ankle(r){R[44]=r;}
function rot_orteil_d(r){R[45]=r;}
function rot_r_knee2(r){R[46]=r;}
function rot_l_hip(r){R[51]=r;}
function rot_l_buttok(r){R[52]=r;}
function rot_l_knee(r){R[54]=r;}
function rot_l_ankle(r){R[55]=r;}
function rot_orteil_g(r){R[56]=r;}
function rot_l_knee2(r){R[57]=r;}
function rot_pubis(r){R[62]=r;}
function VtxTransform(){
var i;
m0=new VrmlMatrix();
m0.setTransform(P[0],R[0]);
m1=new VrmlMatrix();
m1.setTransform(P[1],R[1]);m1=m1.multRight(m0);
m2=new VrmlMatrix();
m2.setTransform(P[2],R[2]);m2=m2.multRight(m1);
for(i=0;i<30;i++){W[i]=m2.multVecMatrix(V[i]);}
m3=new VrmlMatrix();
m3.setTransform(P[3],R[3]);m3=m3.multRight(m2);
for(i=30;i<80;i++){W[i]=m3.multVecMatrix(V[i]);}
m4=new VrmlMatrix();
m4.setTransform(P[4],R[4]);m4=m4.multRight(m3);
for(i=80;i<150;i++){W[i]=m4.multVecMatrix(V[i]);}
m5=new VrmlMatrix();
m5.setTransform(P[5],R[5]);m5=m5.multRight(m4);
for(i=150;i<171;i++){W[i]=m5.multVecMatrix(V[i]);}
m5.setTransform(P[6],R[6]);m5=m5.multRight(m4);
for(i=171;i<192;i++){W[i]=m5.multVecMatrix(V[i]);}
m5.setTransform(P[7],R[7]);m5=m5.multRight(m4);
for(i=192;i<211;i++){W[i]=m5.multVecMatrix(V[i]);}
m6=new VrmlMatrix();
m6.setTransform(P[8],R[8]);m6=m6.multRight(m5);
m7=new VrmlMatrix();
m7.setTransform(P[9],R[9]);m7=m7.multRight(m6);
for(i=211;i<296;i++){W[i]=m7.multVecMatrix(V[i]);}
m8=new VrmlMatrix();
m8.setTransform(P[10],R[10]);m8=m8.multRight(m7);
for(i=296;i<339;i++){W[i]=m8.multVecMatrix(V[i]);}
m9=new VrmlMatrix();
m9.setTransform(P[11],R[11]);m9=m9.multRight(m8);
for(i=339;i<368;i++){W[i]=m9.multVecMatrix(V[i]);}
m9.setTransform(P[12],R[12]);m9=m9.multRight(m8);
for(i=368;i<397;i++){W[i]=m9.multVecMatrix(V[i]);}
m9.setTransform(P[13],R[13]);m9=m9.multRight(m8);
for(i=397;i<438;i++){W[i]=m9.multVecMatrix(V[i]);}
m8.setTransform(P[14],R[14]);m8=m8.multRight(m7);
for(i=438;i<479;i++){W[i]=m8.multVecMatrix(V[i]);}
m9.setTransform(P[15],R[15]);m9=m9.multRight(m8);
m8.setTransform(P[16],R[16]);m8=m8.multRight(m7);
m8.setTransform(P[17],R[17]);m8=m8.multRight(m7);
m7.setTransform(P[18],R[18]);m7=m7.multRight(m6);
for(i=479;i<482;i++){W[i]=m7.multVecMatrix(V[i]);}
m8.setTransform(P[19],R[19]);m8=m8.multRight(m7);
m7.setTransform(P[20],R[20]);m7=m7.multRight(m6);
for(i=482;i<491;i++){W[i]=m7.multVecMatrix(V[i]);}
m8.setTransform(P[21],R[21]);m8=m8.multRight(m7);
m7.setTransform(P[22],R[22]);m7=m7.multRight(m6);
for(i=491;i<500;i++){W[i]=m7.multVecMatrix(V[i]);}
m5.setTransform(P[23],R[23]);m5=m5.multRight(m4);
for(i=500;i<525;i++){W[i]=m5.multVecMatrix(V[i]);}
m6.setTransform(P[24],R[24]);m6=m6.multRight(m5);
for(i=525;i<534;i++){W[i]=m6.multVecMatrix(V[i]);}
m6.setTransform(P[25],R[25]);m6=m6.multRight(m5);
for(i=534;i<554;i++){W[i]=m6.multVecMatrix(V[i]);}
m7.setTransform(P[26],R[26]);m7=m7.multRight(m6);
for(i=554;i<578;i++){W[i]=m7.multVecMatrix(V[i]);}
m8.setTransform(P[27],R[27]);m8=m8.multRight(m7);
for(i=578;i<591;i++){W[i]=m8.multVecMatrix(V[i]);}
m8.setTransform(P[28],R[28]);m8=m8.multRight(m7);
for(i=591;i<643;i++){W[i]=m8.multVecMatrix(V[i]);}
m7.setTransform(P[29],R[29]);m7=m7.multRight(m6);
for(i=643;i<653;i++){W[i]=m7.multVecMatrix(V[i]);}
m5.setTransform(P[30],R[30]);m5=m5.multRight(m4);
for(i=653;i<678;i++){W[i]=m5.multVecMatrix(V[i]);}
m6.setTransform(P[31],R[31]);m6=m6.multRight(m5);
for(i=678;i<687;i++){W[i]=m6.multVecMatrix(V[i]);}
m6.setTransform(P[32],R[32]);m6=m6.multRight(m5);
for(i=687;i<707;i++){W[i]=m6.multVecMatrix(V[i]);}
m7.setTransform(P[33],R[33]);m7=m7.multRight(m6);
for(i=707;i<731;i++){W[i]=m7.multVecMatrix(V[i]);}
m8.setTransform(P[34],R[34]);m8=m8.multRight(m7);
for(i=731;i<744;i++){W[i]=m8.multVecMatrix(V[i]);}
m8.setTransform(P[35],R[35]);m8=m8.multRight(m7);
for(i=744;i<796;i++){W[i]=m8.multVecMatrix(V[i]);}
m8.setTransform(P[36],R[36]);m8=m8.multRight(m7);
m7.setTransform(P[37],R[37]);m7=m7.multRight(m6);
for(i=796;i<806;i++){W[i]=m7.multVecMatrix(V[i]);}
m7.setTransform(P[38],R[38]);m7=m7.multRight(m6);
m3.setTransform(P[39],R[39]);m3=m3.multRight(m2);
m4.setTransform(P[40],R[40]);m4=m4.multRight(m3);
for(i=806;i<849;i++){W[i]=m4.multVecMatrix(V[i]);}
m5.setTransform(P[41],R[41]);m5=m5.multRight(m4);
for(i=849;i<870;i++){W[i]=m5.multVecMatrix(V[i]);}
m6.setTransform(P[42],R[42]);m6=m6.multRight(m5);
m5.setTransform(P[43],R[43]);m5=m5.multRight(m4);
for(i=870;i<901;i++){W[i]=m5.multVecMatrix(V[i]);}
m6.setTransform(P[44],R[44]);m6=m6.multRight(m5);
for(i=901;i<921;i++){W[i]=m6.multVecMatrix(V[i]);}
m7.setTransform(P[45],R[45]);m7=m7.multRight(m6);
for(i=921;i<927;i++){W[i]=m7.multVecMatrix(V[i]);}
m6.setTransform(P[46],R[46]);m6=m6.multRight(m5);
for(i=927;i<935;i++){W[i]=m6.multVecMatrix(V[i]);}
m7.setTransform(P[47],R[47]);m7=m7.multRight(m6);
m6.setTransform(P[48],R[48]);m6=m6.multRight(m5);
m5.setTransform(P[49],R[49]);m5=m5.multRight(m4);
m3.setTransform(P[50],R[50]);m3=m3.multRight(m2);
m4.setTransform(P[51],R[51]);m4=m4.multRight(m3);
for(i=935;i<978;i++){W[i]=m4.multVecMatrix(V[i]);}
m5.setTransform(P[52],R[52]);m5=m5.multRight(m4);
for(i=978;i<994;i++){W[i]=m5.multVecMatrix(V[i]);}
m6.setTransform(P[53],R[53]);m6=m6.multRight(m5);
m5.setTransform(P[54],R[54]);m5=m5.multRight(m4);
for(i=994;i<1025;i++){W[i]=m5.multVecMatrix(V[i]);}
m6.setTransform(P[55],R[55]);m6=m6.multRight(m5);
for(i=1025;i<1045;i++){W[i]=m6.multVecMatrix(V[i]);}
m7.setTransform(P[56],R[56]);m7=m7.multRight(m6);
for(i=1045;i<1051;i++){W[i]=m7.multVecMatrix(V[i]);}
m6.setTransform(P[57],R[57]);m6=m6.multRight(m5);
for(i=1051;i<1059;i++){W[i]=m6.multVecMatrix(V[i]);}
m7.setTransform(P[58],R[58]);m7=m7.multRight(m6);
m6.setTransform(P[59],R[59]);m6=m6.multRight(m5);
m5.setTransform(P[60],R[60]);m5=m5.multRight(m4);
m3.setTransform(P[61],R[61]);m3=m3.multRight(m2);
m4.setTransform(P[62],R[62]);m4=m4.multRight(m3);
for(i=1059;i<1063;i++){W[i]=m4.multVecMatrix(V[i]);}
Vtx.point=W;
}//VtxTransform
function fooEvents(t){
if(mode==2)
Vtx.point.setByVertexTransform(V,vgroups,P,R);
else
VtxTransform();
}
function eventsProcessed(){ if( allowGest ){
if(mode==2) Vtx.point.setByVertexTransform(V,vgroups,P,R);
else VtxTransform();
}}
function Gstart(g,t){
if(currG==-1){nextG=g;Gend(FALSE,t);}
else{ts[currG].stopTime=t;ts[currG].enabled=FALSE;currG=-1;nextG=g;}
}
function Gend(b,t){
if(b==false){
currG=nextG;
if(nextG != -1){
P[1]=Pc;R=R0;
ts[nextG].enabled=TRUE;ts[nextG].startTime=t;nextG=-1;}
eventsProcessed();
}}
function G0(t){
if(watched && !sitting)
{ if(currG!=-1)
ts[currG].stopTime=t;
Gstart(0,t);}}
function G1(t){
if(currG!=-1)
ts[currG].stopTime=t;
sitting=FALSE;
if(watched)Gstart(1,t);} //dance gesture
function G2(t){
if(watched && !sitting)
{if(currG!=-1)
ts[currG].stopTime=t;
Gstart(2,t);}}
function G3(t){
if(watched && !sitting)
{if(currG!=-1)
ts[currG].stopTime=t;
Gstart(3,t);}}
function G4(t){
if(watched && !sitting)
{if(currG!=-1)
ts[currG].stopTime=t;
Gstart(4,t); }} //idle gesture
function G5(t){
if(watched && !sitting)
{if(currG!=-1)
ts[currG].stopTime=t;
Gstart(5,t);}}
function G6(t){
if(currG!=-1)
ts[currG].stopTime=t;
sitting=TRUE;
if(watched)Gstart(6,t);} //sitdown gesture
function G7(t){
if(watched && !sitting)
{if(currG!=-1)
ts[currG].stopTime=t;
Gstart(7,t);}}
function G8(t){
if(currG!=-1)
ts[currG].stopTime=t;
sitting=FALSE;
if(watched)Gstart(8,t);} //walk gesture
function G9(t){
if(currG!=-1)
ts[currG].stopTime=t;
sitting=FALSE;
if(watched)Gstart(9,t);} //swim gesture
function Touch(t){ G0(t);}
function initialize() {
if (V.length==0){ //prevent twice
R=R0;
V=Vtx.point;
W.length=829;
initialized = TRUE;
}
name=Browser.getName();
if(name=='blaxxunCC3D'){
ver=Browser.getVersion();
if(ver<4.0)mode=0; //no eventsProcess
else if(ver<4.1)mode=1; //eventsProcess ok
else mode=2; //setByVertexTransform()
}
else if(name=='CosmoPlayer')mode=1; //eventsProcess ok
eventsProcessed();
}
function Watched(b){ //from VisibilitySensor
if(V.length==0){
http://Browser.print('lili Watched, not yet initialized');
initialize();
}
watched=b;
}
function shutdown(){bye=TRUE;}
" #url
}#script Welder