media @ VU
[] readme course preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthoughts appendix references examples resources _

talk show tell print

proto-rif-interface-tabwindow.vr

proto-rif-interface-tabwindow.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  

tabwindow


  

Web3D/VR

#@extern @vr-extern-proto-object-box.wrl PROTO TabWindow [ exposedField MFNode children [] exposedField SFVec3f scale 1 1 1 exposedField SFColor color 0.3 0.3 0.3 exposedField SFFloat transparency 0 exposedField SFBool touchEnabled FALSE eventOut SFTime touchTime field SFVec2f position 0 0 field SFVec2f size 1 1 ] { DEF TRANS Transform { scale IS scale children [ Transform { translation 0 -0.2 0.01 children [ DEF SWITCH switch { choice IS children } ] } DEF BUTTONS Transformation { } ] } DEF SCRIPT Script { directOutput TRUE field SFNode switchNode USE SWITCH field SFNode buttonGroup USE BUTTONS field SFNode transformNode USE TRANS field SFVec2f position IS position field SFVec2f size IS size url "vrmlscript: function initialize() { var i = 0; transformNode.translation = new SFVec3f(position.x,position.y,0); buttonGroup.translation = new SFVec3f(0,size.y/2+0.1,0); var buttonWidth = size.x/switchNode.choice.length; var buttonPos = -size.x/2; for(i=0;i<switchNode.choice.length;i++) { buttonGroup.addChildren = Browser.createVrmlFromString( 'Button { '+ 'title \0042' + switchNode.choice[i].title + '\0042 '+ 'position '+buttonPos+' 0 0 ' + 'size '+buttonWidth+' 0.2 0 '+ '} ' ); } } " } }


(C) A. Eliëns 21/5/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.