{"id":3056,"date":"2013-05-07T11:10:19","date_gmt":"2013-05-07T09:10:19","guid":{"rendered":"http:\/\/hintz.bplaced.net\/?p=3056"},"modified":"2023-03-04T19:39:46","modified_gmt":"2023-03-04T18:39:46","slug":"hexagon","status":"publish","type":"post","link":"http:\/\/hintz.bplaced.net\/en\/2013\/webgl\/hexagon\/","title":{"rendered":"Hexagon"},"content":{"rendered":"<p>This are just some simple rotating lines in differrent colors, which can form a hexagon.<\/p>\n<p class=\"webgl\"><img decoding=\"async\" src=\"http:\/\/hintz.bplaced.net\/images\/2013\/05\/hexagon.jpg\" \/><a href=\"https:\/\/glslsandbox.com\/e#8532.4\"><canvas width=\"620\" height=\"620\"><script type=\"x-shader\/x-vertex\">attribute vec2 position; void main() { gl_Position = vec4(position, 0, 1); }<\/script><script type=\"x-shader\/x-fragment\">\n#ifdef GL_ES\nprecision mediump float;\n#endif\nuniform float time;\nuniform vec2 mouse;\nuniform vec2 resolution;\n#define M_PI 3.141592653589793\n\/\/ hexagon by @hintz 2013-05-07\nvoid main(void)\n{\n\tvec2 position = (gl_FragCoord.xy - 0.5 * resolution.xy) \/ resolution.x;\n\tfloat a = 0.1*time*M_PI\/3.0;\n\tfloat c = cos(a);\n\tfloat s = sin(a);\n\tmat2 rotate = mat2(c,s,-s,c);\n\tvec3 color = vec3(length(position));\n\tcolor.rg *= abs(0.2-position.x);\n\tvec2 p2 = position * rotate;\n\tcolor.gb *= abs(0.2-p2.x);\n\tvec2 p3 = p2 * rotate;\n\tcolor.br *= abs(0.2-p3.x);\n\tvec2 p4 = p3 * rotate;\n\tcolor.rg *= abs(0.2-p4.x);\n\tvec2 p5 = p4 * rotate;\n\tcolor.gb *= abs(0.2-p5.x);\n\tvec2 p6 = p5 * rotate;\n\tcolor.br *= abs(0.2-p6.x);\n\tcolor.g *= abs(position.x);\n\tcolor.b *= abs(p2.x);\n\tcolor.r *= abs(p3.x);\t\n\tgl_FragColor = vec4(1.0-100000.0*color, 1.0);\n}\n<\/script><\/canvas><\/a><\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This are just some simple rotating lines in differrent colors, which can form a hexagon.<\/p>\n","protected":false},"author":1,"featured_media":3059,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[144],"tags":[149,150,189],"_links":{"self":[{"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/posts\/3056"}],"collection":[{"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/comments?post=3056"}],"version-history":[{"count":9,"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/posts\/3056\/revisions"}],"predecessor-version":[{"id":3451,"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/posts\/3056\/revisions\/3451"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/media\/3059"}],"wp:attachment":[{"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/media?parent=3056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/categories?post=3056"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hintz.bplaced.net\/en\/wp-json\/wp\/v2\/tags?post=3056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}