<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.1//EN" "http://www.web3d.org/specifications/x3d-3.1.dtd"><X3D profile='Immersive' version='3.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation=' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<![CDATA[
ecmascript:
function R () {
return Math.random();
}
function recompute (isActive) {
if (isActive==true) initialize();
}
function initialize() {
for (i=0; i < 10; i++) {
rand1 = 100*R();
rand2 = 100*R();
rand3 = 20*R();
rand4 = 40*R();
rand5 = 20*R();
sceneString ='Transform { \n' +
' translation ' + rand1 + ' 0 ' + rand2 + ' \n' +
' children [ \n' +
' Shape { \n' +
' appearance Appearance { \n' +
' material Material { \n' +
' diffuseColor ' + R() + ' ' + R() + ' ' + R() + '\n' +
' } \n' +
' } \n' +
' geometry Box { \n' +
' size ' + rand3 + ' ' + rand4 + ' ' + rand5 + '\n' +
' } \n' +
' } \n' +
' ] \n' +
'} \n' +
'#########################################################\n';
Browser.print (sceneString);
newNode = Browser.createVrmlFromString(sceneString);
// newNode = Browser.createX3dFromString(sceneString);
ModifiableExternalNode.children[i] = newNode[0];
}
}
]]>
<!-- Tag color codes: <Node DEF='idName' attribute='value'/> -->