alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: createVrmlFromString Sat 27 Jan - 21:17 | |
| LOOOOLL http://www.web3d-fr.com/foroum/index.php?showtopic=3602&st=0&gopid=15168&#entry15168 http://dumenieu.free.fr/vrml/zik/switchpoureric.wrl dont : - Code:
-
#VRML V2.0 utf8 DEF dad_Extrusion Transform { rotation 1.0 0.0 0.0 1.571 children [ DEF Extrusion Transform { rotation 0.0 1.0 0.0 1.047 children [ DEF Sensor1 TouchSensor { } DEF Extrusion99987 Shape { appearance Appearance { material DEF White Material { ambientIntensity 0.200 shininess 0.200 diffuseColor 1 0 0 } } geometry IndexedFaceSet { solid TRUE creaseAngle 3.000 coord DEF ee Coordinate { point [ ] } coordIndex [ ] } } ] } ]} DEF Tr32 Transform { scale .01 .01 .01 children Shape { appearance Appearance { material Material { diffuseColor .6 .6 .6 } texture DEF diams MovieTexture { url "diamsparamour.mp3" } } geometry Box { size .01 01 01} } } ROUTE Sensor1.touchTime TO diams .startTime DEF script Script { field MFNode abox USE dad_Extrusion field MFVec3f translation [ 0 .1 0 0 .2 0 0 .3 0 0 .4 0 0 .5 0 0 .6 0 0 .7 0 0 .8 0 0 .9 0 0 1.0 0 0 1.1 0 0 1.2 0 0 1.3 0 0 1.4 0 0 1.5 0 0 1.6 0 0 1.7 0 0 1.8 0 0 1.9 0 0 2.0 0 0 2.1 0 ]
field MFRotation rotation [ 0 1 0 .1 0 1 0 .2 0 1 0 .3 0 1 0 .4 0 1 0 .5 0 1 0 .6 0 1 0 .7 0 1 0 .8 0 1 0 .9 0 1 0 .10 0 1 0 .11 0 1 0 .12 0 1 0 .13 0 1 0 .14 0 1 0 .15 0 1 0 .16 0 1 0 .17 0 1 0 .18 0 1 0 .19 0 1 0 .20 0 1 0 .21 ]
eventOut MFNode addChildren directOutput TRUE url "vrmlscript: function initialize() { for (i=0;i<translation.length;i++){ node=Browser.createVrmlFromString( 'Transform{translation '+translation[i]+' rotation '+rotation[i]+' }'); node[0].addChildren=abox; addChildren=node; } } " }DEF tous Transform { children [ DEF group Group {
}]} ROUTE script.addChildren TO group.addChildren | |
|