Android Interview Collection video OpenGL ES

Source: Internet
Author: User

1. How do I draw a triangle with OpenGL es?
    • Write a class implement renderer interface, implement Ondrawframe method, Onsurfacechanged method, onsurfacecreated method
    • Write a class triangle class, define fixed-point coordinates, load all vertex coordinates, call a gldrawarrays method of GL10 to draw a triangle
    • Finally, call triangle.drawself in the overridden Ondrawframe method to actually draw the triangle

2.OpenGL es What are the methods for drawing a rectangle?
    • Triangular rotation (but requires a corner of 90 degrees)
    • Vertex method to draw a rectangle, first define 4 vertex coordinates
    • Index method to draw a rectangle

3. What are the limitations of drawing polygons using the index method?
    • You must use byte[] to define a fixed-point index with no more than 255 indexes

4. How do I draw a four-sided pyramid?
    • Note: Any image drawn using OpenGL ES is spelled out with a triangle.
    • Define 4 faces, 3 points per polygon
    • Then ondrawframe the method to draw 4 triangles to form a four-pyramid

5. How do I color the 6 faces of a cube?
    • A color consists of 4 values (RGBA), 4 vertices per plane, and a plane requires 16 values to describe the color
    • The cube has 6 faces and requires a total of 96 values to describe the color
    • Define a 96-length array to record the color, and then use the Gldrawarrays method to draw the cube

What kinds of light sources does 6.OpenGL es support?
    • Directional light
    • Positioning light

7. What is the meaning of the ambient light, scattered light and specular reflection of OpenGL ES light source?
    • The pname parameter value of ambient light is gl10.gl_ambient, which represents the rgba intensity of ambient light added by a particular light source in the scene. 、
    • Scattered light, the parameter is Gl10.gl_diffuse, comes from a certain direction, after hitting the surface of the object, it will scatter evenly.
    • Specular reflection Light, parameter: Gl10.gl_specular, from a specific direction

Android Interview Collection video OpenGL ES

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.