| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>Ejemplo de X3DOM</title>
- <script type='text/javascript' src='scripts/x3dom/x3dom-full-physics.js'> </script>
- <link rel='stylesheet' type='text/css' href='css/x3dom.css'></link>
- <meta http-equiv='Content-Type' content='text/html;charset=utf-8' />
- </head>
- <body>
- <h1>Ejemplo de ejecución de X3DOM</h1>
- <p>
- José Luis Fernández Aguilera
- </p>
- <x3d width='600px' height='400px'>
- <scene>
- <navigationInfo id='head' headlight='false' type='NONE'> </navigationInfo>
- <Viewpoint position='0,0,20' orientation='0,0,0,1'></Viewpoint>
- <background skyColor='0 0 0'></background>
- <DirectionalLight on ='true' ambienIntensity='0.2' direction='0,-1,0'
- color='1 1 1' global='true' shadowintensity='0.5' shadowmapsize='512'
- shadowfiltersize='16'></DirectionalLight>
- <!-- Esfera de la escena -->
- <transform DEF='BALL-TRANS' translation='0,2,0' rotation='0,0,1,0'>
- <shape>
- <appearance>
- <material ambientintensity='0.2' diffuseColor='1,0,0' shininess='0.3'></material>
- </appearance>
- <sphere radius='1'></sphere>
- </shape>
- </transform>
- <collidableShape DEF='BALL-GEOM' enabled='true' rotation='0,0,1,0' translation='0,2,0' containerField='children'>
- <transform USE='BALL-TRANS' containerField='physics'></transform>
- <shape containerField='Shape'>
- <sphere radius='1'></sphere>
- </shape>
- </collidableShape>
- <transform DEF='SMALLBALL-TRANS' translation='2,2,0' rotation='0,0,1,0'>
- <shape>
- <appearance>
- <material ambientintensity='0.2' diffuseColor='0.2,0,0.8' shininess='0.3'></material>
- </appearance>
- <sphere radius='0.5'></sphere>
- </shape>
- </transform>
- <collidableShape DEF='SMALLBALL-GEOM' enabled='true' rotation='0,0,1,0' translation='2,2,0' containerField='children'>
- <transform USE='SMALLBALL-TRANS' containerField='physics'></transform>
- <shape containerField='Shape'>
- <sphere radius='0.5'></sphere>
- </shape>
- </collidableShape>
- <!-- Suelo en el que se sostendrá todo -->
- <transform DEF='GROUND-TRANS' translation='0,-5,0' rotation='0,0,1,0' >
- <shape>
- <appearance>
- <material diffuseColor='0.2,0.2,0.2'></material>
- </appearance>
- <box size='15,0.1,15'></box>
- </shape>
- </transform>
- <collidableShape DEF='GROUND-GEOM' translation='0.0,-5,0.0' enabled='true' rotation='0,0,1,0' containerField='children'>
- <transform USE='GROUND-TRANS' containerField='physics'></transform>
- <shape containerField='Shape'>
- <box size='15,0.1,15'></box>
- </shape>
- </collidableShape>
- <rigidBodyCollection DEF='BODY-COLLECTION' autoDisable='false' constantForceMix='0.0001' contactSurfaceThickness='0.5' disableAngularSpeed='0' disableLinearSpeed='0' disableTime='0' enabled='true' errorCorrection='0.8' gravity='0 -9.8 0' iterations='10' maxCorrectionSpeed='-1' preferAccuracy='false' containerField='children'>
- <rigidBody DEF='BODY-1' containerField='bodies' position='0.0 2.0 0.0' angularDampingFactor='0.001' angularVelocity='0 0 0' autoDamp='false' autoDisable='false' centerOfMass='0 0 0' disableAngularSpeed='0' disableLinearSpeed='0' disableTime='0' enabled='true' finiteRotationAxis='0 1 0' fixed='false' inertia='1 0 0 0 1 0 0 0 1' linearDampingFactor='0.001' linearVelocity='0 0 0' mass='1' orientation='0 0 1 0' useFiniteRotation='false' useGlobalGravity='true'>
- <collidableShape USE='BALL-GEOM' containerField='geometry' enabled='true' rotation='0 0 1 0' translation='0 0 0'></collidableShape>
- </rigidBody>
- <rigidBody DEF='BODY-2' containerField='bodies' position='0.0 2.0 0.0' angularDampingFactor='0.001' angularVelocity='0 0 0' autoDamp='false' autoDisable='false' centerOfMass='0 0 0' disableAngularSpeed='0' disableLinearSpeed='0' disableTime='0' enabled='true' finiteRotationAxis='0 1 0' fixed='false' inertia='1 0 0 0 1 0 0 0 1' linearDampingFactor='0.001' linearVelocity='0 0 0' mass='0' orientation='0 0 1 0' useFiniteRotation='false' useGlobalGravity='true'>
- <collidableShape USE='GROUND-GEOM' containerField='geometry' enabled='true' rotation='0 0 1 0' translation='0 0 0'></collidableShape>
- </rigidBody>
- <rigidBody DEF='BODY-3' containerField='bodies' position='0.0 2.0 0.0' angularDampingFactor='0.001' angularVelocity='0 0 0' autoDamp='false' autoDisable='false' centerOfMass='0 0 0' disableAngularSpeed='0' disableLinearSpeed='0' disableTime='0' enabled='true' finiteRotationAxis='0 1 0' fixed='false' inertia='1 0 0 0 1 0 0 0 1' linearDampingFactor='0.001' linearVelocity='0 0 0' mass='1' orientation='0 0 1 0' useFiniteRotation='false' useGlobalGravity='true'>
- <collidableShape USE='SMALLBALL-GEOM' containerField='geometry' enabled='true' rotation='0 0 1 0' translation='0 0 0'></collidableShape>
- </rigidBody>
- </rigidBodyCollection>
- <collisionSensor DEF='COLLISION-OUTPUT' enabled='true'>
- <collisionCollection DEF='COLLISION-GROUP' bounce='0.8' containerField='collidables' minBounceSpeed='1.0' appliedParameters='BOUNCE' enabled='true' frictionCoefficients='0.1 0.1' slipFactors='0 0' softnessConstantForceMix='0.0001' softnessErrorCorrection='0.8' surfaceSpeed='0 0'>
- <collidableShape USE='BALL-GEOM' containerField='collidables' enabled='true' rotation='0 0 1 0' translation='0 0 0'></collidableShape>
- <collidableShape USE='GROUND-GEOM' containerField='collidables' enabled='true' rotation='0 0 1 0' translation='0 0 0'></collidableShape>
- <collidableShape USE='SMALLBALL-GEOM' containerField='collidables' enabled='true' rotation='0 0 1 0' translation='0 0 0'></collidableShape>
- </collisionCollection>
- </collisionSensor>
- </scene>
- </x3d>
- </body>
- </html>
|