Search:

Type: Posts; User: wglb

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    1,556

    Re: Full page canvas problem

    You have to play with css, try something like this:

    body {
    margin: 0;
    padding: 0;
    }

    #test {
    margin: 0;
    padding: 0;
  2. Replies
    1
    Views
    2,094

    Re: Drawing WebGL back to 2D Canvas

    Maybe you could use webgl_canvas.toDataUrl("image/png") method to get "screenshot" of the webgl canvas and then use it within canvas2d
  3. Replies
    8
    Views
    6,464

    Re: How to include shaders?

    You can load external text file with shader using XMLHttpRequest object.

    var getSourceSynch = function(url) {
    var req = new XMLHttpRequest();
    req.open("GET", url, false);
    req.send(null);...
  4. Replies
    1
    Views
    2,090

    Light in world coordinates

    Hi,

    I'm in the middle of creating a game which uses lighting (1 light, per fragment, ambient + diffuse for now) (I follow giles' lessons: http://learningwebgl.com/blog/?page_id=1217).
    I have...
  5. Re: Problem with Binary XMLHttpRequest and WebGL buffers

    If you're trying to open local file then add this parameter to the chrome:
    --allow-file-access-from-files
  6. Thread: Text in WebGL

    by wglb
    Replies
    9
    Views
    8,170

    Re: Text in WebGL

    You could use another canvas for creating dynamic texture with text (displaying lines length) and then display f.e. textured (there is ability to use canvas as a texture source) rectangles next to...
  7. Replies
    1
    Views
    1,908

    Re: how to start webgl on gt335

    Have you followed http://learningwebgl.com/blog/?p=11#ins ... sa-windows ?
  8. Replies
    5
    Views
    2,413

    Re: finding out what call caused the INVALID_ENUM?

    There is also complex debugging tool for webgl, but it doesn't work for me: viewtopic.php?f=43&t=3173
  9. Replies
    5
    Views
    2,413

    Re: finding out what call caused the INVALID_ENUM?

    Having getError directly after setInterval makes no sense, because loop() will be called asyncchronously after 1000.0/60.0 miliseconds.
    For debugging javascript - you can use webinspector (for...
  10. Replies
    1
    Views
    2,247

    Re: HTML elements in WebGL 3D context?

    AFAIK you could use canvas.toDataUrl which returns image element. And then try to set canvas position and dimension in the way that it covers needed html elements.
    (I'm not sure if it'll work)
  11. Re: Weird problem while loading multiple textures in a for l

    No, this is asynchronously, it means your JSON loading is in 99% done later, after initTextures(). More details here: https://developer.mozilla.org/en/XMLHttpRequest

    This is equivalent in...
  12. Replies
    1
    Views
    1,796

    Re: Mouse button clicked checking

    WebGL can't but JavaScript can: http://www.w3schools.com/jsref/dom_obj_event.asp
    and example: http://learningwebgl.com/blog/?p=1253
  13. Replies
    2
    Views
    2,747

    Re: Rotation to form a pyramid

    Yes, you use the same rotation for every triangle.
    Rotation angle should depend on j value.
    Try something like:


    var deltaAngle = Math.PI * 2 / n;
    for (var j = 0; j < n; j++) {
    ...
  14. Re: Weird problem while loading multiple textures in a for l

    Do you load JSON asynchronously or synchronously?
  15. Replies
    2
    Views
    2,809

    Khronos' debugging script

    Hi,
    I did everytnig like it's described here: http://khronos.org/webgl/wiki/Debugging but it seems to doesn't work.
    -I added manually gl.getError function to my draw function and I noticed I had...
  16. Replies
    2
    Views
    2,459

    Re: with and without texture

    Isn't it possible to just add some vertex attribute, f.e. "noTex" and for line set it to true and false for the rest? Then in shader you could use / not use texture

    if (noTex) {
    gl_FragColor =...
  17. Replies
    0
    Views
    1,791

    Getting "good" resolutions

    Hi,

    It's my first post on this forum, so hello everybody.

    I want my application to dynamically change canvas and viewport size depending on window dimension (it's handled in onresize event...
Results 1 to 17 of 17