diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-11-02 15:36:19 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-11-02 15:36:19 +0000 |
commit | c823b2bf3165990a556d50990adf4da5cee95593 (patch) | |
tree | 733f3d3a6ed7a5e8f80d4b4553299902d89b58b8 /packages/noncvs/windows/extra/Gem/examples/10.glsl/tri2fan.geom | |
parent | 2c0b722536a4ec2f723c289b695b983741c678f8 (diff) |
commit Gem 0.93.3 from http://gem.iem.at/releases/0.93.3/Gem-0.93.3-W32-i686.zip
svn path=/trunk/; revision=16521
Diffstat (limited to 'packages/noncvs/windows/extra/Gem/examples/10.glsl/tri2fan.geom')
-rw-r--r-- | packages/noncvs/windows/extra/Gem/examples/10.glsl/tri2fan.geom | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/packages/noncvs/windows/extra/Gem/examples/10.glsl/tri2fan.geom b/packages/noncvs/windows/extra/Gem/examples/10.glsl/tri2fan.geom index 45961e25..2206e59b 100644 --- a/packages/noncvs/windows/extra/Gem/examples/10.glsl/tri2fan.geom +++ b/packages/noncvs/windows/extra/Gem/examples/10.glsl/tri2fan.geom @@ -1,51 +1,51 @@ -// Cyrille Henry 2010 - -#version 120 -#extension GL_EXT_geometry_shader4 : enable - -void main(void) -{ - - int i; //increment variable - vec4 pos1,pos2, pos3, pos4, pos5; // tmp - vec3 high; - - for(i=0; i< gl_VerticesIn; i += 3){ // for all triangles - pos1 = gl_PositionIn[i]; - pos2 = gl_PositionIn[i+1]; - pos3 = gl_PositionIn[i+2]; - pos4 = (pos1 + pos2 + pos3) / 3.; // center of the triangle - - high = 10.*cross(pos2.xyz-pos1.xyz,pos3.xyz-pos2.xyz); - // hight and orientation of the piramide - - high = normalize(high); - high *= length(pos2-pos1); - pos5 = pos4 ; - pos5.xyz += high; - - gl_Position = gl_ModelViewProjectionMatrix * pos1; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos4; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos5; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos2; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos4; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos5; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos3; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos4; - EmitVertex(); - gl_Position = gl_ModelViewProjectionMatrix * pos5; - EmitVertex(); - - EndPrimitive(); - // new primitive - } - -} - +// Cyrille Henry 2010
+
+#version 120
+#extension GL_EXT_geometry_shader4 : enable
+
+void main(void)
+{
+
+ int i; //increment variable
+ vec4 pos1,pos2, pos3, pos4, pos5; // tmp
+ vec3 high;
+
+ for(i=0; i< gl_VerticesIn; i += 3){ // for all triangles
+ pos1 = gl_PositionIn[i];
+ pos2 = gl_PositionIn[i+1];
+ pos3 = gl_PositionIn[i+2];
+ pos4 = (pos1 + pos2 + pos3) / 3.; // center of the triangle
+
+ high = 10.*cross(pos2.xyz-pos1.xyz,pos3.xyz-pos2.xyz);
+ // hight and orientation of the piramide
+
+ high = normalize(high);
+ high *= length(pos2-pos1);
+ pos5 = pos4 ;
+ pos5.xyz += high;
+
+ gl_Position = gl_ModelViewProjectionMatrix * pos1;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos4;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos5;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos2;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos4;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos5;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos3;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos4;
+ EmitVertex();
+ gl_Position = gl_ModelViewProjectionMatrix * pos5;
+ EmitVertex();
+
+ EndPrimitive();
+ // new primitive
+ }
+
+}
+
|