OpenGL ES 2 – Tutorial 4 – Colored Vertices
In this tutorial we set the colors of the vertices individually.
In this tutorial we set the colors of the vertices individually.
In questo tutorial imposteremo singolarmente i colori dei vertici
In the first code, for each triangle, we reset, translate, scale and draw. In the second code, we reset, scale (obtaining a basic unit of “100”), translate by 1 (that is 100), draw, translate again by 1 (that is an other 100) on the previous translate, draw.
Nel primo codice, per ogni triangolo, resettiamo, trasliamo, scaliamo e disegniamo. Nel secondo codice, resettiamo, scaliamo (ottenendo come unità di base “100”), trasliamo di 1 (ovvero 100), disegniamo, trasliamo nuovamente di 1 (ovvero altri 100) sulla base della precedente traslazione, disegniamo.
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”.
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 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 è un sottoinsieme delle librerie grafiche OpenGL pensato per dispositivi integrati (telefoni cellulari, PDA ecc. ma anche strumentazione scientifica e industriale). Viene gestito dal consorzio no-profit Khronos Group, che cura anche lo sviluppo della libreria madre OpenGL.
Copyright © 2024 | WordPress Theme by MH Themes