#VRML V2.0 utf8 WorldInfo { info "00/9/21 by GoGoGo, http://www1.plala.or.jp/Studio_GoGoGo/" title "Smooth Cylinder" } NavigationInfo {type "EXAMINE"} Viewpoint {} #np Shape { appearance Appearance { material Material {diffuseColor 1 1 1} } geometry DEF ex Extrusion { spine [0 -1 0, 0 1 0] creaseAngle 0.0982 } } DEF SC Script { eventOut MFVec2f crossSection field SFInt32 n 64 #p field SFFloat radius 1 #Oډ~̔a url "javascript: function initialize(){ r=2*Math.PI/n; cs=new MFVec2f(); for(i=0;i<=n;i++){ ri=r*i; x=Math.cos(ri)*radius; z=-Math.sin(ri)*radius; cs[i]=new SFVec2f(x,z); } crossSection=cs; }" } ROUTE SC.crossSection TO ex.set_crossSection