slt
voila ,j'ai bricoler ce petit script en js (d'apres un prog en Qb) mais il refuse de marcher !!! et comme je 'débute' bienévidement ,je ne trouve pas la panne ^^ pouriez vous essayer de le débuger ?
merci d'avence ! Tix.
Code:<html> <head> <script language="Javascript"> val x3d val y3d val z3d val rotx val roty val rotz val rx val ry val rz val idr val depth = 400 val zoom = 300 val pA val pB val pC val pD val pE val pF val pG val pH function calc3d(x3d, y3d, z3d, rotx, roty, rotz,idr){ x2 = (x3d * Math.cos(rotz)) - (y3d * Math.sin(rotz)) y2 = (x3d * Math.sin(rotz)) + (y3d * Math.cos(rotz)) x3 = (x2 * Math.cos(roty)) - (z3d* Math.sin(roty)) z2 = (x2 * Math.sin(roty)) + (z3d * Math.cos(roty)) y3 = (y2 * Math.cos(rotx)) - (z2 * Math.sin(rotx)) z3 = (y2 * Math.sin(rotx)) + (z2 * Math.cos(rotx)) x2d = zoom * (x3 / (z3 + depth)) + 160 y2d = zoom * (y3 / (z3 + depth)) + 100 x2d = x2d y2d = y2d document.getElementById[idr].style.top=xm document.getElementById[idr].style.left=ym } function cube(){ rx = rx++ ry = ry++ rz = rz++ calc3d( 10, 10, 10, rx, ry, rz,"pA") calc3d( -10, 10, 10, rx, ry,rz,"pB") calc3d( 10, -10, 10, rx, ry, rz,"pC") calc3d( 10, 10, -10, rx, ry, rz,"pD") calc3d( -10, -10, 10, rx, ry, rz,"pE") calc3d( -10, -10, -10, rx, ry, rz,"pF") calc3d( 10, -10, -10, rx, ry, rz,"pG") calc3d( -10, 10, -10, rx, ry, rz,"pH") setTimeout('cube()',10) } </script> </head> <body onload='cube()'> <div id="pA" style="{position:absolute}">o</div> <div id="pB" style="{position:absolute}">o</div> <div id="pC" style="{position:absolute}">o</div> <div id="pD" style="{position:absolute}">o</div> <div id="pE" style="{position:absolute}">o</div> <div id="pF" style="{position:absolute}">o</div> <div id="pG" style="{position:absolute}">o</div> <div id="pH" style="{position:absolute}">o</div> </body> </html>
-----