polygons !!
le tableau de float :
#define NB_POINTS_FACADE_BOITIER 78
float mdl_facade_boitier[NB_POINTS_FACADE_BOITIER][3] = {
//façade (argh !!!)
//bloc intérupteurs
{-0.95f, 3.15f, 2.0f},
{-0.75f, 3.15f, 2.45f},
{0.75f, 3.15f, 2.45f},
{-0.95f, 3.15f, 2.0f},
{0.75f, 3.15f, 2.45f},
{0.95f, 3.15f, 2.0f},
{-0.95f, 2.6f, 2.0f},
{-0.75f, 2.6f, 2.45f},
{0.75f, 2.6f, 2.45f},
{-0.95f, 2.6f, 2.0f},
{0.75f, 2.6f, 2.45f},
{0.95f, 2.6f, 2.0f},
{-0.75f, 3.15f, 2.45f},
{0.75f, 3.15f, 2.45f},
{-0.75f, 2.6f, 2.45f},
{-0.75f, 2.6f, 2.45f},
{0.75f, 3.15f, 2.45f},
{0.75f, 2.6f, 2.45f},
{-0.75f, 3.15f, 2.45f},
{-0.95f, 2.6f, 2.0f},
{-0.95f, 3.15f, 2.0f},
{-0.75f, 3.15f, 2.45f},
{-0.75f, 2.6f, 2.45f},
{-0.95f, 2.6f, 2.0f},
{0.75f, 3.15f, 2.45f},
{0.95f, 2.6f, 2.0f},
{0.95f, 3.15f, 2.0f},
{0.75f, 3.15f, 2.45f},
{0.75f, 2.6f, 2.45f},
{0.95f, 2.6f, 2.0f},
//partie baies
{0.95f, 2.6f, 2.0f},
{-0.95f, 2.6f, 2.0f},
{-0.95f, -0.15f, 2.0f},
{0.95f, 2.6f, 2.0f},
{-0.95f, -0.15f, 2.0f},
{0.95f, -0.15f, 2.0f},
//bas avec trou ventilo
{-0.95f, -0.15f, 2.0f},
{-0.75f, -0.15f, 2.45f},
{0.75f, -0.15f, 2.45f},
{-0.95f, -0.15f, 2.0f},
{0.75f, -0.15f, 2.45f},
{0.95f, -0.15f, 2.0f},
{-0.95f, -3.15f, 2.0f},
{-0.75f, -3.15f, 2.45f},
{0.75f, -3.15f, 2.45f},
{-0.95f, -3.15f, 2.0f},
{0.75f, -3.15f, 2.45f},
{0.95f, -3.15f, 2.0f},
{-0.75f, -0.15f, 2.45f},
{-0.95f, -0.15f, 2.0f},
{-0.95f, -3.15f, 2.0f},
{-0.75f, -0.15f, 2.45f},
{-0.95f, -3.15f, 2.0f},
{-0.75f, -3.15f, 2.45f},
{0.75f, -0.15f, 2.45f},
{0.95f, -0.15f, 2.0f},
{0.95f, -3.15f, 2.0f},
{0.75f, -0.15f, 2.45f},
{0.95f, -3.15f, 2.0f},
{0.75f, -3.15f, 2.45f},
{-0.75f, -0.15f, 2.45f},
{0.75f, -0.15f, 2.45f},
{-0.75f, -1.95f, 2.45f},
{0.75f, -0.15f, 2.45f},
{-0.75f, -1.95f, 2.45f},
{0.75f, -1.95f, 2.45f},
//côtés ventilo
{-0.75f, -1.95f, 2.45f},
{-0.6f, -1.95f, 2.45f},
{-0.75f, -3.15f, 2.45f},
{-0.6f, -1.95f, 2.45f},
{-0.75f, -3.15f, 2.45f},
{-0.6f, -3.15f, 2.45f},
{0.75f, -1.95f, 2.45f},
{0.6f, -1.95f, 2.45f},
{0.75f, -3.15f, 2.45f},
{0.6f, -1.95f, 2.45f},
{0.75f, -3.15f, 2.45f},
{0.6f, -3.15f, 2.45f}};
et utilisation du tableau :
void alim() {
glColor4fv(grisfonce);
glMaterialfv(GL_FRONT, GL_DIFFUSE, grisfonce);
glMaterialfv(GL_FRONT, GL_SPECULAR, grisfonce);
glMaterialfv(GL_FRONT, GL_AMBIENT, grisfonce);
//glMaterialf(GL_FRONT, GL_SHININESS, 8.0f);
glTranslatef(2.1f, 1.93f, -1.3f);
glBegin(GL_TRIANGLES);
for (i=0 ; i<NB_POINTS_ALIM ; i++)
glVertex3f(mdl_alim[i][0], mdl_alim[i][1], mdl_alim[i][2]);
glEnd() ;
glTranslatef(-0.4f, 0.0f, -0.575f);
ventilo(8.0f, rotation_ventilo);
//remise à 000 de l'origine
glTranslatef(0.4f, 3.0f, -2.925f);
}
Pour info c'est une partie de mon proget d'opengl (mon pc)
---------------
Chết rồi ! ✍ ⌥⌘ http://github.com/gwenhael-le-moine/slackbuilds/