redcone_1.wrl source
#VRML V2.0 utf8

Viewpoint {}

NavigationInfo {
type "EXAMINE"
}

# 円錐が配置される場所
DEF Gp Group {}

# スクリプト
DEF Sc Script {
eventOut MFNode children
field SFColor red 1 0 0
url "javascript:

function initialize() {

var coneStr = 'Shape { geometry Cone {} }';
var apprStr = 'Appearance { material Material {} }';

var cone = new SFNode ( coneStr );
var appr = new SFNode ( apprStr );

appr.material.diffuseColor = red;
cone.appearance = appr;

children[0] = cone;

}

"
}

ROUTE Sc.children TO Gp.children