Last active
February 26, 2018 20:27
-
-
Save mahulst/cacdf340ce969f482c3507bd266f45b5 to your computer and use it in GitHub Desktop.
Revisions
-
mahulst revised this gist
Feb 26, 2018 . 2 changed files with 11 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ void main () { float y = calculateSurface(position.x, position.y); vec3 p1 = vec3(vert1.x, calculateSurface(vert1.x, vert1.y), vert1.y); vec3 p2 = vec3(vert2.x, calculateSurface(vert2.x, vert2.y), vert2.y); vec3 p3 = vec3(vert3.x, calculateSurface(vert3.x, vert3.y), vert3.y); vec3 normal = normalize(cross(p2 - p3, p1 - p2)); gl_Position = perspective * camera * vec4(vec3(position.x, y, position.y), 1.0); vcolor = normal; } -
mahulst created this gist
Feb 26, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ void main () { float y = calculateSurface(position.x, position.y); vec3 p1 = vec3(vert1.x, calculateSurface(vert1.x, vert1.y), vert1.y); vec3 p2 = vec3(vert2.x, calculateSurface(vert2.x, vert2.y), vert2.y); vec3 p3 = vec3(vert3.x, calculateSurface(vert3.x, vert3.y), vert3.y); vec3 normal = normalize(cross(p2 - p3, p1 - p2)); gl_Position = perspective * camera * vec4(vec3(position.x, y, position.y), 1.0); vcolor = normal; }