1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| vector<vec3f>vertex; // struct 3 floats .. // contains the vertices
vector<vec3i>index_vertex; // struct 2 ints .. // contains the face indices
vector<vec3f>normal;
vector<vec3i>index_normal;
vector<vec2d>texture;
vector<vec3i>index_texture;
/// load fonction
{
// bla bla
// remplissage des tableaux
// pour les vertex array
// je ne sait pas si c'est une fois à l'init qu'il faut mettre ces fonctions,
// mais logiquement, c'est bien ca
glNormalPointer( GL_FLOAT,0,&normal[0]);
glVertexPointer(3,GL_FLOAT,0,&vertex[0]);
}
///
/// draw fonction
{
// affichage
glDrawElements(GL_TRIANGLES,sizeof(&index_vertex[0])/sizeof(float),GL_UNSIGNED_INT,&index_vertex[0]);
}
/// |