OpenGL ES 2.0 Camera with projection

Source: Internet
Author: User

1. Camera settings
    • Location coordinates of the camera
    • Location of the camera
    • Camera Up direction
1 Matrix.setlookatm (2     Mvmatrix,    // storage Generation matrix element float[] Type array     3      0,               / / Fill start offset    4     Cx,cy,cz,       //  X, y, z coordinates of camera position 5     Tx,ty,tz,        // observation    target point x, y, Z coordinates 6     //up vector component   7 on the x, y, Z axis  ;    
2. Projection mode-Orthogonal projection

Set viewport

1 gles20.glviewport (x,y,width,height);

Orthogonal projection is a kind of parallel projection, whose projection line (the vertex of the object is connected with the near-plane projection point) is parallel. A graphic projected into the near plane does not produce a "near-large" effect in the real world.

1 Matrix.orthom (2     Mprojmatrix,    // storage Generation matrix element float[] Type array 3     0,        // fill start offset 4     left,right,    //leftof near face, right  5     bottom,top,    //bottom,top near face6     Near,far    //near face, far side and distance from viewpoint 7 );
3. Projection mode-Perspective projection

The projection lines of the perspective projection are not parallel, and they intersect at the viewpoint. Through the perspective can be produced in the real world "near big far small" effect.

1 Matrix.frustumm (2     Mprojmatrix,    // storage Generation matrix element float[] Type array 3     0,        // Fill Start offset 4     Left,right,    //leftof near face, right5     bottom,top,    //  Near surface of the Bottom,top6     near,far    //close face, far side and the distance of the viewpoint 7 );

OpenGL ES 2.0 Camera with projection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.