OpenGL ES 2 – Tutorial 2 – Draw a Triangle

With “this.objtriangle = new ObjTriangle();” we call the constructor of “ObjTriangle” class where we set the data of our triangle. The vertices of the triangle present in “vertices” and “indices” (written counterclockwise) are not in a format useful for OpenGL, in the constructor they are converted and stored in “vertexBuffer” and “indexBuffer”.

OpenGL ES 2 – Tutorial 2 – Disegnare un Triangolo

Con “this.objtriangle = new ObjTriangle();” richiamiamo il costruttore della classe “ObjTriangle” dove settiamo i dati del nostro triangolo. I vertici del triangolo presenti in “vertices” e “indices” (scritti in senso antiorario) non sono in un formato utile ad OpenGL, nel costruttore vengono converititi e memorizzati in “vertexBuffer” e “indexBuffer”.

OpenGL ES 2 – Tutorial 1 – Basic 2D Project

OpenGL for Embedded Systems (OpenGL ES or GLES) is a subset of the OpenGL computer graphics rendering application programming interface (API) for rendering 2D and 3D computer graphics such as those used by video games, typically hardware-accelerated using a graphics processing unit (GPU). It is designed for embedded systems like smartphones, tablet computers, video game consoles and PDAs.

OpenGL ES 1 – Tutorial 5 – Draw Squares

Every shape we want to draw must be brought back into triangles, therefore OpenGL will draw the square with 2 triangles. The “indices” variable specifies the vertices to be taken from “vertices” for each triangle (counterclockwise). For the first triangle, pair of coordinates x,y: 0, 1 and 2, for the second triangle, pair of coordinates x,y: 2, 1 and 3.

OpenGL ES 1 – Tutorial 5 – Disegnare Quadrati

Ogni forma che vogliamo disegnare deve essere ricondotta in triangoli, quindi OpenGL disegnerà il quadrato tramite 2 triangoli. La variabile “indices” specifica i vertici da prendere da “vertices” per ogni triangolo (in senso antiorario). Per il primo triangolo, coppia coordinate x,y: 0, 1 e 2, per il secondo triangolo, coppia coordinate x,y: 2, 1 e 3.