Results 1 to 2 of 2

Thread: gl.Frustr...ATION

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1

    gl.Frustr...ATION

    Khronos, when will you add glFrustum to WebGL standard?

  2. #2
    Junior Member
    Join Date
    Jun 2011
    Posts
    7

    Re: gl.Frustr...ATION

    Never.

    You have to do it yourself (calcule the matrix, send it to your projection mat).
    Code :
    function glFrustum(left, right, bottom, top, near, far) {
    	var rl = right-left, tb = top-bottom, fn = far-near;
    	<webgl context>.uniformMatrix4fv( <webgl projection uniform matrix>, false, Float32Array([
    		(near*2) / rl, 0, 0, 0,
    		0, (near*2) / tb, 0, 0,
    		(right + left) / rl,  (top + bottom) / tb, -(far + near) / fn, -1,
    		0, 0, -(far*near*2) / fn, 0
    	]); );
    };

    I recommend you to use an existent matrix library in javascript (since I think you don't want to build your own).

Posting Permissions

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