   Sphere maping - Enviroment Maping
  helloi want to make an effect such as by using GL_SPHERE_MAP///////////////////////////////////////////////////i came to the result, it should work like thisS = 0.5 * N * transpose(M) + (0.5, 0.5, 0.0, 0.0)S = (s,t,r,q) //texture u=s v=tN = (n0,n1,n2,n3) //face normalM = (m00,m04,m08,m12) //modelview matrix    (m01,m05,m09,m13)   (m02,m06,m10,m14)    (m03,m07,m11,m15)inv(M) = transpose(M)///////////////////////////////////////////////////   model->texcoords[2*i + 0] =    0.5 * (    model->normals[3*i + 0] * m[0]  + 0.5 +    model->normals[3*i + 1] * m[4]  + 0.5 +    model->normals[3*i + 2] * m[8]  +    model->normals[3*i + 3] * m[12]    );   model->texcoords[2*i + 1] =    0.5 * (    model->normals[3*i + 0] * m[1]  + 0.5 +    model->normals[3*i + 1] * m[5]  + 0.5 +    model->normals[3*i + 2] * m[9]  +    model->normals[3*i + 3] * m[13]    );but it dont work as expected any idea?   
  I'm not sure if this will help you at all since you are using OpenGL, but in my signature there is a link to a free online D3D10 book that discusses sphere mapping and the mathematics to derive it.  Perhaps it could serve as a reference for your implementation?   