OpenGL ES 3 point, line, triangle drawing form Summary

Source: Internet
Author: User

OpenGL ES 3.0

Vertex

-1, 1, 0,
-0.5f, 0, 0,
0,-1, 0,
-1, 0, 0,
0.5f, 0, 0,
1,-1, 0

Vertices are set to size 20

    public static final String vertex3 =            "#version es \ n" +            "uniform mat4 umvpmatrix;\n"              + "layout (location =  0) in vec3 aposition;\n "              +" layout (location = 1) in vec2 atexcoor;\n "              +" out vec2 vtexturecoord;\n "               +" void Main () {\ n "              +" gl_position  = Umvpmatrix * VEC4 (aposition,1); \ n "             +" gl_pointsize = 20.0;\n "            +" Vtext Urecoord = atexcoor;\n "               +"}\n "  

   public static final String fragment4 = "#version es \ n" +                "precision mediump float;\n"            + "in Vec2 Vtexturecoor d;\n "            +" out vec4 v_color;\n "          +" void Main () {\ n "            +" vec2 coord =  vtexturecoord;\n "            +" V_color = Vec4 (1.0,1.0,1.0,0.0); \ n "            +"}\n "            ;  

Gles30.gldrawarrays Drawing shapes

Gl_points, draw some.

Gl_lines Draw line, 2-point connection

Gl_line_loop let the line loop closed

Gl_line_strip draw lines are not closed

Gl_triangles draw a triangle, three points to draw a

Gl_triangle_strip each vertex and 2 other vertex joins to form a triangle

Gl_triangle_fan draw a triangle fan, you can draw shapes like circles

OpenGL ES 3 point, line, triangle drawing form Summary

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.