Results 1 to 3 of 3

Thread: Webgl by Vertrigo

  1. #1
    Junior Member
    Join Date
    Jun 2011

    Webgl by Vertrigo

    Hi people, I am a beginner in WebGL, and I'm running into a problem WebGL.

    After I save the code in notepad + +, I open the file through a simulation server, the vertrigo, but when I open the page, it does not work.
    I'll have to buy a domain to always check the progress of my project?

    I only use firefox and google chrome.


  2. #2
    Junior Member
    Join Date
    May 2011

    Re: Webgl by Vertrigo

    You should not need a simulation server. With an html file that contains something similar to

    <html lang="en"><head>
    <title>gl64k - the webgl competition</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <style type="text/css">
    * { margin: 0px; padding:0px; }
    <canvas id="canvas"></canvas>
    <script type="text/javascript" >
    var gl = (function () {
    var d=document, w=window, c=d.getElementById('canvas'),
    gl = c.getContext('experimental-webgl');

    function resize() {
    c.width = w.innerWidth;
    c.height = w.innerHeight;
    gl.viewport(0, 0, c.width, c.height);
    }; resize(); w.addEventListener('resize', resize, false);

    return gl;
    <script type="text/javascript" src="YOURS.js"></script>

    and webgl in the file YOURS.js you should be able to test using a file path URL in Chrome. No need for a server simulator unless you code needs server support.

    Your file path URL will look something like

    There is nothing special about the name YOURS.js and you can modularize your code
    by including multiple such lines.

  3. #3
    Junior Member
    Join Date
    Jun 2011

    Re: Webgl by Vertrigo

    It's Work! Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts