sizeofimage("environ.sgi", &Sx, &Sy);
imageData = longimagedata("environ1.sgi");
texture = glGenLists(1);
glNewList(texture, GL_COMPILE); glEndList();

Hangle = fatan2(Head[0], Head[2])/(float)M_PI/2.;
Vangle = fatan2(Head[1], sqrt(Head[2]*Head[2]+Head[0]*Head[0])/(float)M_PI/2.;
glCallList(texture);

tm[0] = 0.5; tm[4] = 0; tm[8] = 0; tm[12] = Hangle+0.25;
tm[1] = 0; tm[5] = 0.5; tm[9] = 0; tm[13] = Vangle;
tm[2] = 0; tm[6] = 0; tm[10] = 1; tm[14] = 0;
tm[3] = 0; tm[7] = 0; tm[11] = 0; tm[15] = 1;

glPushMatrix();

glPopMatrix();