My 3D Library Test wellflat Follow 2010-08-01 22:45:57 License: MIT License Fork2 Fav6 View2531 Play Stop Reload Fullscreen Smart Phone Fork tree Readme JavaScript 0 lines HTML 44 lines CSS 5 lines My 3D Library Test my3dlib.js <section> <h2>My 3D Library Test</h2> <div class="wrap"> <canvas id="Canvas" width="300" height="300"></canvas> <input id="PlayButton" type="button" value=" play " > <input id="StopButton" type="button" value=" stop " > </div> </section> <script> window.addEventListener('load', function(e) { var canvas = document.querySelector('#Canvas'); var playBtn = document.querySelector('#PlayButton'); var stopBtn = document.querySelector('#StopButton'); var screen = new Screen(300, 300, 55); var scene = new Scene3D(); var renderer = new BasicRenderEngine(canvas, screen); var material = new WireframeMaterial(canvas, '#0099ff', 1); var scale = 50; var h = Math.sqrt(3)/2*scale; var vertices = [ new Vertex3D(0, h, h), new Vertex3D(-scale, -h, h), new Vertex3D(scale, -h, h), new Vertex3D(0, 0, -h) ]; var triangular = [ new TriangleMesh3D(material, [vertices[0], vertices[1], vertices[2]]), new TriangleMesh3D(material, [vertices[0], vertices[2], vertices[3]]), new TriangleMesh3D(material, [vertices[0], vertices[3], vertices[1]]), new TriangleMesh3D(material, [vertices[3], vertices[2], vertices[1]]) ]; scene.addObject(triangular); renderer.renderScene(scene, 0.05); playBtn.addEventListener('click', function(e) { renderer.renderScene(scene, 0.05); }, false); stopBtn.addEventListener('click', function(e) { renderer.stop(); }, false); }, false); </script> My 3D Library Test body{ font-size:12px; color:#ccc; background-color:#000; text-align:center; margin:20px; } .wrap{ width:300px; margin:20px auto; display: block;} canvas{ border:1px solid #0099ff; } input[type="button"]{ font-family:Verdana, sans-serif; color:#fff; background-color:#666; border:none; padding:2px 8px; } input[type="button"]:hover{ background-color: #333; } <section> <h2>My 3D Library Test</h2> <div class="wrap"> <canvas id="Canvas" width="300" height="300"></canvas> <input id="PlayButton" type="button" value=" play " > <input id="StopButton" type="button" value=" stop " > </div> </section> <script> window.addEventListener('load', function(e) { var canvas = document.querySelector('#Canvas'); var playBtn = document.querySelector('#PlayButton'); var stopBtn = document.querySelector('#StopButton'); var screen = new Screen(300, 300, 55); var scene = new Scene3D(); var renderer = new BasicRenderEngine(canvas, screen); var material = new WireframeMaterial(canvas, '#0099ff', 1); var scale = 50; var h = Math.sqrt(3)/2*scale; var vertices = [ new Vertex3D(0, h, h), new Vertex3D(-scale, -h, h), new Vertex3D(scale, -h, h), new Vertex3D(0, 0, -h) ]; var triangular = [ new TriangleMesh3D(material, [vertices[0], vertices[1], vertices[2]]), new TriangleMesh3D(material, [vertices[0], vertices[2], vertices[3]]), new TriangleMesh3D(material, [vertices[0], vertices[3], vertices[1]]), new TriangleMesh3D(material, [vertices[3], vertices[2], vertices[1]]) ]; scene.addObject(triangular); renderer.renderScene(scene, 0.05); playBtn.addEventListener('click', function(e) { renderer.renderScene(scene, 0.05); }, false); stopBtn.addEventListener('click', function(e) { renderer.stop(); }, false); }, false); </script> body{ font-size:12px; color:#ccc; background-color:#000; text-align:center; margin:20px; } .wrap{ width:300px; margin:20px auto; display: block;} canvas{ border:1px solid #0099ff; } input[type="button"]{ font-family:Verdana, sans-serif; color:#fff; background-color:#666; border:none; padding:2px 8px; } input[type="button"]:hover{ background-color: #333; } use an iframe compat browser, deer Play on jsdo.it games Share Embed QR Tag Download Complete! Description どんなゲームですか? Control Device スマートフォンコントローラー jsdo.it WebSocket Controller» マウス キーボード タッチデバイス Fullscreen 有効 無効 jsdo.it games から削除する Submit Tweet style Design view Code view code <script type="text/javascript" src="http://jsdo.it/blogparts/zmko/js?view=design"></script><p class="ttlBpJsdoit" style="width: 465px; margin: 0; text-align: right; font-size: 11px;"><a href="http://jsdo.it/wellflat/zmko" title="My 3D Library Test">My 3D Library Test - jsdo.it - share JavaScript, HTML5 and CSS</a></p> 3D Canvas Library Tweet twitter Tags 3D Canvas Library Favorite by puram1245 motikawa canvastag yasigani-ni: 3D clockmaker: 3D y3i12: Niiice! Seems to be very simple to use. Forked sort new page view favorite forked forked from: My 3D Library Tes.. uepon24 00 264views 3/44/5 forked from: My 3D Library Tes.. tetchan 00 275views 35/8/5