Results 1 to 2 of 2

Thread: Grab Projection and view Matrices without glGet*

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    1

    Grab Projection and view Matrices without glGet*

    Hello,

    seeing as I have found out GLES 1.0 is not compatible with the glGet*
    functions, how can I store this internally in my app? here is a code
    example

    void Camera::SetProjectionMatrix(float aspect, float fov, float
    nearPlane, float farPlane)
    {
    glMatrixMode(GL_PROJECTION);
    float top, bottom, left, right;

    top = tan(fov*0.5) * nearPlane;
    bottom = -top;
    left = aspect * bottom;
    right = aspect * top;

    glLoadIdentity();
    glFrustumf(left,right,bottom,top,nearPlane,farPlan e);
    glMatrixMode(GL_MODELVIEW);
    m_dirty = true;
    }

    I am using GLES 1.0 and am using native OpenGL for the Android.

    Thanks alot

  2. #2
    V-man
    Guest

    Re: Grab Projection and view Matrices without glGet*

    This is a function that computes the matrix and returns it to you
    http://www.opengl.org/wiki/GluPerspective_code

    There are other math and matrix libraries as well. A long list is here
    http://www.gamedev.net/topic/291432-...ree-libraries/

    There is a GLU version for GL ES. I think it is called GLU ES. Check out the forums at http://www.khronos.org

Similar Threads

  1. Creating multiple planes in 3D view (projection view)
    By Bhoot123 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-20-2018, 02:40 AM
  2. Ray origin through view and projection matrices
    By FrankBoltzmann in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-16-2014, 11:49 AM
  3. Directional light and shadow mapping view/projection matrices
    By TheKaiser in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-30-2014, 12:09 PM
  4. Directional light and shadow mapping view/projection matrices
    By TheKaiser in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-27-2014, 02:58 PM
  5. glGet for matrices doesn't seem to work
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-05-2000, 10:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean