1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| void Planete::afficher(void) {
float mat_emission[4] = {1.0f, 1.0f, 1.0f, 1.0f};
float mat_no_emission[4] = {0.0f, 0.0f, 0.0f, 1.0f};
if (Sname == "Soleil" ) {
glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission);
} else {
glMaterialfv(GL_FRONT, GL_EMISSION, mat_no_emission);
}
glPushMatrix();
glTranslated(pos.get_x(), pos.get_y(), pos.get_z());
double R = radius;
glColor3ub(255, 255, 255);
glRotated(angle, rot.get_x(), rot.get_y(), rot.get_z());
GLUquadric* params = gluNewQuadric();
gluQuadricTexture(params,GL_TRUE);
glBindTexture(GL_TEXTURE_2D,text_day_map);
gluSphere(params, R, 50, 50);
gluDeleteQuadric(params);
glPopMatrix();
} |
Partager