toolpaths_lines.vs 456 B

12345678910111213141516171819
  1. #version 110
  2. varying vec3 eye_normal;
  3. vec3 world_normal()
  4. {
  5. // the world normal is always parallel to the world XY plane
  6. // the x component is stored into gl_Vertex.w
  7. float x = gl_Vertex.w;
  8. float y = sqrt(1.0 - x * x);
  9. return vec3(x, y, 0.0);
  10. }
  11. void main()
  12. {
  13. vec4 world_position = vec4(gl_Vertex.xyz, 1.0);
  14. gl_Position = gl_ModelViewProjectionMatrix * world_position;
  15. eye_normal = gl_NormalMatrix * world_normal();
  16. }