##:@* block ## ##@ info ## ## This is the VrmlElement PROTO, ## it can be placed within the context of a textblock and ## contains raw-vrml content. ## ## Note that the size (w/h) is hardcoded, ## the trans/rot/scale fields are only applied on the children ! ## ## Fields (that should be modified): ## exposedField SFInt32 startLevel -1 ## exposedField SFInt32 endLevel -1 ## ## exposedField SFFloat width 1 ## exposedField SFFloat height 1 ## ## exposedField SFVec3f location 0 0 0 ## exposedField SFRotation rotation 0 1 0 0 ## exposedField SFVec3f scale 1 1 1 ## exposedField MFNode children [] ## ##@ block PROTO BlockElement [ exposedField SFString elementType "BLOCKELEMENT" exposedField SFVec3f position 0 0 0 exposedField SFBool linebreak FALSE exposedField SFBool absolute FALSE exposedField SFInt32 startLevel -1 exposedField SFInt32 endLevel -1 eventIn SFInt32 showLevel exposedField SFString href "" exposedField SFFloat width 1 exposedField SFFloat height 1 exposedField MFString justify ["BEGIN"] exposedField SFVec3f location 0 0 0 exposedField SFRotation rotation 0 1 0 0 exposedField SFVec3f scale 1 1 1 exposedField MFNode block [] ] { ##@ body Transform { translation IS position children [ DEF TRANSFORM Transform { children [ Transform { translation IS location rotation IS rotation scale IS scale children IS block } ] } ] } ##@ script DEF SCRIPT Script { directOutput TRUE field SFFloat width IS width field SFFloat height IS height field SFNode transform USE TRANSFORM field MFNode blocks IS block field SFInt32 endLevel IS endLevel eventOut SFInt32 endLevel_changed IS endLevel eventIn SFInt32 showLevel IS showLevel field SFBool absolute IS absolute url "javascript: function initialize() { if (!absolute) transform.translation = new SFVec3f(width/2,height/2,0); var i = 0; var maxLevel = 0; for(i=0;i maxLevel) { maxLevel = blocks[i].lastLevel; } } endLevel = maxLevel; //endLevel = -1; endLevel_changed = maxLevel; } function showLevel(value,time) { var i = 0; for(i=0;i