   [GLSL] Geometry Shader Sphere Subdivision problem
  Hi,I am currently trying to familiarize myself with shaders, especially geometry shaders since I finally got a graphic card supporting them.The most valuable ressource I have found is the book Graphic Shaders: Theory And Practice, http://books.google.fr/books?id=29YSpc-aOlgC&pg=PA30&lpg=PA30&dq=geometry+shader+sphere+sub&source=bl&ots=SpCVl9zA9G&sig=W4mBYO5OJUMSnvtT1JWO5hgJMyc&hl=de&ei=nj76S4_cK5OeOLfNyJUM&sa=X&oi=book_result&ct=result&resnum=8&ved=0CEMQ6AEwBw#v=onepage&q=geometry%20shader%20sphere%20sub&f=falseThe problem I have, when trying to use the sphere subdivision shader from this book (in which I hardcoded some values), is that the shader output (triangle_strip) is moving with my camera in a complete incoherence way... My guess it that the use of transformation matrices in the shader shouldn't be that way because of my camera class. Note: the shader works well with glman, but I want to use it with my code.The shader:#version 120    #extension GL_EXT_gpu_shader4: enable    #extension GL_EXT_geometry_shader4: enableuniform int Level;   uniform float Radius; varying float LightIntensity;   vec3 V0, V01, V02;    void  ProduceVertex( float s, float t )   {   const vec3 lightPos = vec3( 0., 10., 0. );vec3 v = V0 + s*V01 + t*V02;   v = normalize(v);    vec3 n = v;  // vec3 tnorm = normalize( gl_NormalMatrix * n );  // the transformed normal    vec4 ECposition = gl_ModelViewMatrix * vec4( (1.0*v), 1. );    // LightIntensity  = dot( normalize(lightPos - ECposition.xyz), tnorm );    // LightIntensity = abs( LightIntensity );    // LightIntensity *= 1.5;gl_Position = gl_ProjectionMatrix * ECposition;    EmitVertex();}   void  main(){   V01 = ( gl_PositionIn[1] - gl_PositionIn[0] ).xyz; V02 = ( gl_PositionIn[2] - gl_PositionIn[0] ).xyz; V0  =   gl_PositionIn[0].xyz;   int numLayers = 1 << 2;    float dt = 1. / float( numLayers );  float t_top = 1.;for( int it = 0; it < numLayers; it++ )  {   float t_bot = t_top - dt; float smax_top = 1. - t_top;   float smax_bot = 1. - t_bot;    int nums = it + 1;   float ds_top = smax_top / float( nums - 1 );  float ds_bot = smax_bot / float( nums );  float s_top = 0.;    float s_bot = 0.;for( int is = 0; is < nums; is++ )  {   ProduceVertex( s_bot, t_bot ); ProduceVertex( s_top, t_top ); s_top += ds_top;s_bot += ds_bot;  } ProduceVertex( s_bot, t_bot ); EndPrimitive();  t_top = t_bot;  t_bot -= dt; }  }  ----------------------For the complete project (needs SFML and CMake to build), you can download it there:ludovicfavre.ch/files/GeomGLSL.tar.gzhttp://rapidshare.com/files/390989938/GeomGLSL.tar.gz.htmlMain files: GLApp.cpp (main app class), camera/Camera.cpp (camera handling), glsl/spheresubd.geom (the shader).Any idea what I have done wrong in my code ?    