#VRML V2.0 utf8 ####################################################### # WhiteBoard.wrl (24-Sep-1998) # ============================= # Conception : David Ott, TECFA # TecSupport : Sylvere Martin-Michiellot, TECFA # Copyright : David.Ott@tecfa.unige.ch # # Free for all non-commercial uses if you keep this notice # intact and share with other. # # Description : still not working... # # Next steps : none for the moment ;) # ######################################################## NavigationInfo { type "NONE" } Viewpoint { position 0 0 11 } Transform { translation 0 4 0 children [ Shape { geometry Text { fontStyle FontStyle { justify ["MIDDLE","MIDDLE"] style "SANS" } string "The BlackBoard" } } ] } Transform { translation 0 -4 0 children [ Shape { geometry Text { fontStyle FontStyle { justify ["MIDDLE","MIDDLE"] size .5 style "SANS" } string "David.Ott@tecfa.unige.ch" } } ] } Transform { translation 0 0 .1 children [ Shape { geometry DEF ILS IndexedLineSet { colorPerVertex FALSE coord DEF Coord Coordinate {} color Color { color 1 1 1} } } ] } Transform { #scale 2 2 1 children [ DEF PS PlaneSensor {} Shape { appearance Appearance { material DEF couleur Material { diffuseColor .6 .6 .9 transparency .6 } } geometry Box {size 9 7 .1} } Transform { translation 0 3.5 0 rotation 0 0 1 1.57 children [ Shape { appearance Appearance { material DEF cadre Material { diffuseColor 1 0 0 } } geometry Cylinder { height 9 radius .1} } ] } Transform { translation 0 -3.5 0 rotation 0 0 1 1.57 children [ Shape { appearance Appearance { material DEF cadre Material { diffuseColor 1 0 0 } } geometry Cylinder { height 9 radius .1} } ] } Transform { translation -4.5 0 0 #rotation 0 0 1 1.57 children [ Shape { appearance Appearance { material DEF cadre Material { diffuseColor 1 0 0 } } geometry Cylinder { height 7 radius .1} } ] } Transform { translation 4.5 0 0 #rotation 0 0 1 1.57 children [ Shape { appearance Appearance { material DEF cadre Material { diffuseColor 1 0 0 } } geometry Cylinder { height 7 radius .1} } ] } ] } DEF SCR Script { eventIn SFVec3f newPos eventIn SFBool endOfLine field MFVec3f theArray [] field MFInt32 theIndexArray [] field SFInt32 numOfLines 1 #field SFInt32 negMinusOne -1 field SFNode pointArray USE Coord #field SFNode coordIndex USE ILS eventOut MFInt32 coordIndex eventOut MFVec3f point url [ "vrmlscript: function newPos(actualPosition) { theArray[theArrayLength()] = new SFVec3f(actualPosition.x,actualPosition.y,actualPosition.z); coordIndex[theIndexArrayLength()] = theArrayLength(); point = theArray; print('1pt'); } function theArrayLength() { return pointArray.point.length; } function theIndexArrayLength() { return theArrayLength() + numOfLines; } function oneMoreLine(a) { coordIndex[theIndexArrayLength()] = a; } function endOfLine(valeur) { if (valeur == FALSE) { numOfLines++; //coordIndex[theIndexArrayLength()] = -1; print('------ ONE MORE LINE ------'); coordIndex[theIndexArrayLength()-1] = -1; print('indexArrayLength = ' + theIndexArrayLength()); //print('coordIndex content = ' + coordIndex[theIndexArrayLength()]); print('numOfLines = ' + numOfLines); print('coordIndex = ' + coordIndex); print('----- DRAWING POINTS -----'); } } " ] } # Route ProximitySensor to Script ROUTE PS.trackPoint_changed TO SCR.newPos ROUTE PS.isActive TO SCR.endOfLine # Route Script to IndexedLineSet ROUTE SCR.point TO Coord.point ROUTE SCR.coordIndex TO ILS.coordIndex