Nos partenaires et nous-mêmes utilisons différentes technologies, telles que les cookies, pour personnaliser les contenus et les publicités, proposer des fonctionnalités sur les réseaux sociaux et analyser le trafic. Merci de cliquer sur le bouton ci-dessous pour donner votre accord. Vous pouvez changer d’avis et modifier vos choix à tout moment. Informations RGPD
<html> <head> <title>My first X3DOM page</title> <script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'> </script> <link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'></link> <style> x3d { border:2px solid darkorange; background: rgba(128, 128, 128, 0.4); } body { font-size:110%; font-family:verdana, sans-serif; background-image: url('pattern.png'); margin: 3em; color: lightgray; } h1 { color: darkorange; } </style> </head> <body> <h1>Hello, X3DOM!</h1> <p> This is my first html page with some 3d objects. </p> <script> function changeColor() { if(document.getElementById("color").getAttribute('diffuseColor')=="1 0 0") document.getElementById("color").setAttribute('diffuseColor', '0 0 1'); else if(document.getElementById("color").getAttribute('diffuseColor')=="0 0 1") document.getElementById("color").setAttribute('diffuseColor', '0 1 0'); else document.getElementById("color").setAttribute('diffuseColor', '1 0 0'); } </script> <x3d width='600px' height='400px'> <scene> <shape onclick="changeColor();"> <appearance> <material id="color" diffuseColor='1 0 0'></material> </appearance> <box></box> </shape> <transform translation='-3 0 0'> <shape> <appearance> <material diffuseColor='0 1 0'></material> </appearance> <cone></cone> </shape> </transform> <transform translation='3 0 0'> <shape> <appearance> <material diffuseColor='0 0 1'></material> </appearance> <sphere></sphere> </shape> </transform> </scene> </x3d> </body> </html>