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