Skip to content

Instantly share code, notes, and snippets.

@MAKIO135
Last active August 22, 2019 22:53
Show Gist options
  • Save MAKIO135/eab7b74e85ed2be48eeb to your computer and use it in GitHub Desktop.
Save MAKIO135/eab7b74e85ed2be48eeb to your computer and use it in GitHub Desktop.

Revisions

  1. MAKIO135 revised this gist May 29, 2016. 1 changed file with 0 additions and 63 deletions.
    63 changes: 0 additions & 63 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -59,68 +59,5 @@
    init();
    animate();
    </script>

    <script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    </head>
    <body style="background:#fff;">
    <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"><\/script>
    <canvas id="canvas"></canvas>
    </body>
    </html></script>


    <script id="jsbin-source-javascript" type="text/javascript">var width = window.innerWidth, height = window.innerHeight / 2;
    var size = 256;
    var canvas = document.getElementById('canvas'),
    ctx = canvas.getContext('2d');

    var camera, scene, renderer, geometry, texture, mesh;

    function changeCanvas() {
    ctx.font = '20pt Arial';
    ctx.fillStyle = 'red';
    ctx.fillRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = 'white';
    ctx.fillRect(10, 10, canvas.width - 20, canvas.height - 20);
    ctx.fillStyle = 'black';
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";
    ctx.fillText(new Date().getTime(), canvas.width / 2, canvas.height / 2);
    }

    function init() {
    renderer = new THREE.WebGLRenderer();
    renderer.setSize(width, height);
    document.body.appendChild(renderer.domElement);

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(70, width / height, 1, 1000);
    camera.position.z = 500;
    scene.add(camera);

    texture = new THREE.Texture(canvas);
    var material = new THREE.MeshBasicMaterial({ map: texture });
    geometry = new THREE.BoxGeometry( 200, 200, 200 );
    mesh = new THREE.Mesh( geometry, material );
    scene.add( mesh );

    canvas.width = canvas.height = size;
    }

    function animate() {
    requestAnimationFrame(animate);

    changeCanvas();
    texture.needsUpdate = true;
    mesh.rotation.y += 0.01;
    renderer.render(scene, camera);
    }

    init();
    animate();</script></body>
    </html>
  2. MAKIO135 revised this gist Sep 30, 2014. 1 changed file with 0 additions and 50 deletions.
    50 changes: 0 additions & 50 deletions jsbin.fovenu.js
    Original file line number Diff line number Diff line change
    @@ -1,50 +0,0 @@
    var width = window.innerWidth, height = window.innerHeight / 2;
    var size = 256;
    var canvas = document.getElementById('canvas'),
    ctx = canvas.getContext('2d');

    var camera, scene, renderer, geometry, texture, mesh;

    function changeCanvas() {
    ctx.font = '20pt Arial';
    ctx.fillStyle = 'red';
    ctx.fillRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = 'white';
    ctx.fillRect(10, 10, canvas.width - 20, canvas.height - 20);
    ctx.fillStyle = 'black';
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";
    ctx.fillText(new Date().getTime(), canvas.width / 2, canvas.height / 2);
    }

    function init() {
    renderer = new THREE.WebGLRenderer();
    renderer.setSize(width, height);
    document.body.appendChild(renderer.domElement);

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(70, width / height, 1, 1000);
    camera.position.z = 500;
    scene.add(camera);

    texture = new THREE.Texture(canvas);
    var material = new THREE.MeshBasicMaterial({ map: texture });
    geometry = new THREE.BoxGeometry( 200, 200, 200 );
    mesh = new THREE.Mesh( geometry, material );
    scene.add( mesh );

    canvas.width = canvas.height = size;
    }

    function animate() {
    requestAnimationFrame(animate);

    changeCanvas();
    texture.needsUpdate = true;
    mesh.rotation.y += 0.01;
    renderer.render(scene, camera);
    }

    init();
    animate();
  3. MAKIO135 created this gist Sep 30, 2014.
    126 changes: 126 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,126 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    </head>
    <body style="background:#fff;">
    <script src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"></script>
    <canvas id="canvas"></canvas>
    <script id="jsbin-javascript">
    var width = window.innerWidth, height = window.innerHeight / 2;
    var size = 256;
    var canvas = document.getElementById('canvas'),
    ctx = canvas.getContext('2d');

    var camera, scene, renderer, geometry, texture, mesh;

    function changeCanvas() {
    ctx.font = '20pt Arial';
    ctx.fillStyle = 'red';
    ctx.fillRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = 'white';
    ctx.fillRect(10, 10, canvas.width - 20, canvas.height - 20);
    ctx.fillStyle = 'black';
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";
    ctx.fillText(new Date().getTime(), canvas.width / 2, canvas.height / 2);
    }

    function init() {
    renderer = new THREE.WebGLRenderer();
    renderer.setSize(width, height);
    document.body.appendChild(renderer.domElement);

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(70, width / height, 1, 1000);
    camera.position.z = 500;
    scene.add(camera);

    texture = new THREE.Texture(canvas);
    var material = new THREE.MeshBasicMaterial({ map: texture });
    geometry = new THREE.BoxGeometry( 200, 200, 200 );
    mesh = new THREE.Mesh( geometry, material );
    scene.add( mesh );

    canvas.width = canvas.height = size;
    }

    function animate() {
    requestAnimationFrame(animate);

    changeCanvas();
    texture.needsUpdate = true;
    mesh.rotation.y += 0.01;
    renderer.render(scene, camera);
    }

    init();
    animate();
    </script>

    <script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    </head>
    <body style="background:#fff;">
    <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"><\/script>
    <canvas id="canvas"></canvas>
    </body>
    </html></script>


    <script id="jsbin-source-javascript" type="text/javascript">var width = window.innerWidth, height = window.innerHeight / 2;
    var size = 256;
    var canvas = document.getElementById('canvas'),
    ctx = canvas.getContext('2d');

    var camera, scene, renderer, geometry, texture, mesh;

    function changeCanvas() {
    ctx.font = '20pt Arial';
    ctx.fillStyle = 'red';
    ctx.fillRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = 'white';
    ctx.fillRect(10, 10, canvas.width - 20, canvas.height - 20);
    ctx.fillStyle = 'black';
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";
    ctx.fillText(new Date().getTime(), canvas.width / 2, canvas.height / 2);
    }

    function init() {
    renderer = new THREE.WebGLRenderer();
    renderer.setSize(width, height);
    document.body.appendChild(renderer.domElement);

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(70, width / height, 1, 1000);
    camera.position.z = 500;
    scene.add(camera);

    texture = new THREE.Texture(canvas);
    var material = new THREE.MeshBasicMaterial({ map: texture });
    geometry = new THREE.BoxGeometry( 200, 200, 200 );
    mesh = new THREE.Mesh( geometry, material );
    scene.add( mesh );

    canvas.width = canvas.height = size;
    }

    function animate() {
    requestAnimationFrame(animate);

    changeCanvas();
    texture.needsUpdate = true;
    mesh.rotation.y += 0.01;
    renderer.render(scene, camera);
    }

    init();
    animate();</script></body>
    </html>
    50 changes: 50 additions & 0 deletions jsbin.fovenu.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    var width = window.innerWidth, height = window.innerHeight / 2;
    var size = 256;
    var canvas = document.getElementById('canvas'),
    ctx = canvas.getContext('2d');

    var camera, scene, renderer, geometry, texture, mesh;

    function changeCanvas() {
    ctx.font = '20pt Arial';
    ctx.fillStyle = 'red';
    ctx.fillRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = 'white';
    ctx.fillRect(10, 10, canvas.width - 20, canvas.height - 20);
    ctx.fillStyle = 'black';
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";
    ctx.fillText(new Date().getTime(), canvas.width / 2, canvas.height / 2);
    }

    function init() {
    renderer = new THREE.WebGLRenderer();
    renderer.setSize(width, height);
    document.body.appendChild(renderer.domElement);

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(70, width / height, 1, 1000);
    camera.position.z = 500;
    scene.add(camera);

    texture = new THREE.Texture(canvas);
    var material = new THREE.MeshBasicMaterial({ map: texture });
    geometry = new THREE.BoxGeometry( 200, 200, 200 );
    mesh = new THREE.Mesh( geometry, material );
    scene.add( mesh );

    canvas.width = canvas.height = size;
    }

    function animate() {
    requestAnimationFrame(animate);

    changeCanvas();
    texture.needsUpdate = true;
    mesh.rotation.y += 0.01;
    renderer.render(scene, camera);
    }

    init();
    animate();