twocone_1_00.x3d source
<?xml version="1.0" encoding="UTF-8"?>

<X3D>
<Scene>
<Viewpoint/>

<NavigationInfo
type='
"EXAMINE"'
/>

<Group DEF='Gp'>
</Group>

<Script DEF='Sc'>
<field accessType='outputOnly' type='MFNode' name='children'/>
<field accessType='initializeOnly' type='SFColor' name='red' value='1 0 0'/>
<field accessType='initializeOnly' type='SFVec3f' name='left' value='-2 0 0'/>
<field accessType='initializeOnly' type='SFVec3f' name='right' value='2 0 0'/>
<![CDATA[ecmascript:

function initialize() {

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

var coneL = new SFNode ( coneStr + 'height 3 }}' );
var coneR = new SFNode ( coneStr + '}}' );
var appr = new SFNode ( apprStr );

appr.material.diffuseColor = red;
coneL.appearance = appr;
coneR.appearance = appr;

var trnsLt = new SFNode ( trnsStr );
var trnsRt = new SFNode ( trnsStr );
trnsLt.translation = left;
trnsRt.translation = right;
trnsLt.children[0] = coneL;
trnsRt.children[0] = coneR;

children[0] = trnsLt;
children[1] = trnsRt;

}
]]>
</Script>

<ROUTE fromNode='Sc' fromField='children' toNode='Gp' toField='children'/>
</Scene>
</X3D>