ffnord-con-2015-2 hinzugefügt
This commit is contained in:
commit
de72f31357
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#alle Dateien ignorieren...
|
||||||
|
*
|
||||||
|
|
||||||
|
#ausser...
|
||||||
|
!/ffnord-con-2015-2
|
||||||
|
!/ffnord-con-2015-2/*
|
||||||
|
!/ffnord-con-2015-2/*/*
|
||||||
|
!/ffnord-con-2015-2/*/*/*
|
||||||
|
!.gitignore
|
||||||
|
!README
|
2
ffnord-con-2015-2/29c3/LICENSE.txt
Normal file
2
ffnord-con-2015-2/29c3/LICENSE.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Font is Source Code Pro:
|
||||||
|
http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFont&code=SOUC10003050
|
BIN
ffnord-con-2015-2/29c3/bold.ttf
Normal file
BIN
ffnord-con-2015-2/29c3/bold.ttf
Normal file
Binary file not shown.
BIN
ffnord-con-2015-2/29c3/light.ttf
Normal file
BIN
ffnord-con-2015-2/29c3/light.ttf
Normal file
Binary file not shown.
26
ffnord-con-2015-2/29c3/node.lua
Normal file
26
ffnord-con-2015-2/29c3/node.lua
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
gl.setup(1280, 720)
|
||||||
|
|
||||||
|
local scramble = require "scramble"
|
||||||
|
|
||||||
|
util.auto_loader(_G)
|
||||||
|
|
||||||
|
function write(font, x, y, text, size, r, g, b, a)
|
||||||
|
local s = scramble.scramble(text)
|
||||||
|
return function()
|
||||||
|
font:write(x, y, s(), size, r, g, b, a)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local lines = {
|
||||||
|
write(light, 350, 0 * 144, "f/f.n[o", 140, 1 ,.706,0 ,.8),
|
||||||
|
write(light, 50 , 1 * 144, "r.d/-]>", 140, .8 ,.8 ,.7 ,.8),
|
||||||
|
write(light, 600, 2 * 144, "c.o-n/ ", 140, .863,0 ,.404,.8),
|
||||||
|
write(light, 50 , 3 * 144, " / -2.0", 140, .7 ,.7 ,.7 ,.8),
|
||||||
|
write(bold, 350, 4 * 144, "1(5).-2", 140, 0 ,.62 ,.878,.8),
|
||||||
|
}
|
||||||
|
|
||||||
|
function node.render()
|
||||||
|
for i = 1, #lines do
|
||||||
|
lines[i]()
|
||||||
|
end
|
||||||
|
end
|
90
ffnord-con-2015-2/29c3/scramble.lua
Normal file
90
ffnord-con-2015-2/29c3/scramble.lua
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
local sys = require "sys"
|
||||||
|
local math = require "math"
|
||||||
|
local table = require "table"
|
||||||
|
local base = _G
|
||||||
|
|
||||||
|
module("scramble")
|
||||||
|
|
||||||
|
function scramble(text)
|
||||||
|
local all_breaks = '/.-{}()[]<>|,;!?'
|
||||||
|
local breaks = {}
|
||||||
|
for idx = 1, #all_breaks do
|
||||||
|
breaks[all_breaks:sub(idx, idx)]=true
|
||||||
|
end
|
||||||
|
-- print(#breaks)
|
||||||
|
local mode = "up"
|
||||||
|
local interval = 0.2
|
||||||
|
local swap_end
|
||||||
|
local next_action = sys.now() + interval
|
||||||
|
local stack = {}
|
||||||
|
|
||||||
|
local function is_break(text, pos)
|
||||||
|
local char = text:sub(pos, pos)
|
||||||
|
local is_break = breaks[char]
|
||||||
|
-- print(char, is_break)
|
||||||
|
return is_break, char
|
||||||
|
end
|
||||||
|
local function random_break()
|
||||||
|
local pos = math.random(1, #all_breaks)
|
||||||
|
return all_breaks:sub(pos, pos)
|
||||||
|
end
|
||||||
|
local function replace2(text, pos, c1, c2)
|
||||||
|
return text:sub(1, pos-1) .. c1 .. c2 .. text:sub(pos+2)
|
||||||
|
end
|
||||||
|
local function replace(text, pos, c)
|
||||||
|
return text:sub(1, pos-1) .. c .. text:sub(pos+1)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get()
|
||||||
|
local now = sys.now()
|
||||||
|
if now > next_action then
|
||||||
|
-- print(mode)
|
||||||
|
if mode == "up" then
|
||||||
|
local pos, is_1_break, is_2_break, char_1, char_2
|
||||||
|
repeat
|
||||||
|
pos = math.random(1, #text-1)
|
||||||
|
is_1_break, char_1 = is_break(text, pos)
|
||||||
|
is_2_break, char_2 = is_break(text, pos+1)
|
||||||
|
until is_1_break ~= is_2_break
|
||||||
|
-- print(pos, is_1_break, is_2_break)
|
||||||
|
|
||||||
|
if is_1_break then
|
||||||
|
table.insert(stack, {pos, random_break(), char_2})
|
||||||
|
text = replace2(text, pos, char_2, random_break())
|
||||||
|
else
|
||||||
|
table.insert(stack, {pos, char_1, random_break()})
|
||||||
|
text = replace2(text, pos, random_break(), char_1)
|
||||||
|
end
|
||||||
|
interval = interval - 0.01
|
||||||
|
if interval < 0.02 then
|
||||||
|
mode = "down"
|
||||||
|
end
|
||||||
|
elseif mode == "down" then
|
||||||
|
local pos, char1, char2 = base.unpack(table.remove(stack, #stack))
|
||||||
|
text = replace2(text, pos, char1, char2)
|
||||||
|
interval = interval + 0.01
|
||||||
|
if #stack == 0 then
|
||||||
|
mode = "swap"
|
||||||
|
swap_end = now + 15
|
||||||
|
interval = 2
|
||||||
|
end
|
||||||
|
elseif mode == "swap" then
|
||||||
|
local pos, is_break_char, _
|
||||||
|
repeat
|
||||||
|
pos = math.random(1, #text-1)
|
||||||
|
is_break_char, _ = is_break(text, pos)
|
||||||
|
until is_break_char
|
||||||
|
text = replace(text, pos, random_break())
|
||||||
|
if now > swap_end then
|
||||||
|
interval = 0.2
|
||||||
|
mode = "up"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
next_action = now + interval
|
||||||
|
end
|
||||||
|
return text
|
||||||
|
end
|
||||||
|
return get
|
||||||
|
end
|
||||||
|
|
||||||
|
|
7
ffnord-con-2015-2/31c3/COPYRIGHT
Normal file
7
ffnord-con-2015-2/31c3/COPYRIGHT
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Created by Florian Wesch <fw@dividuum.de>
|
||||||
|
|
||||||
|
This work is licensed under a Creative Commons Attribution 4.0 International License.
|
||||||
|
http://creativecommons.org/licenses/by/4.0/
|
||||||
|
|
||||||
|
The tiles.png, package.png, screenshot.jpg are based on the design by graphorama
|
||||||
|
http://www.graphorama.de/blog/31c3-das-design/
|
6
ffnord-con-2015-2/31c3/README.creole
Normal file
6
ffnord-con-2015-2/31c3/README.creole
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
= A 31c3 themed background pattern
|
||||||
|
|
||||||
|
{{screenshot.jpg|Screenshot}}
|
||||||
|
|
||||||
|
Background pattern for the
|
||||||
|
[[http://events.ccc.de/congress/2014/wiki/Static:Main_Page|31c3 conference in Hamburg]].
|
4
ffnord-con-2015-2/31c3/node.json
Normal file
4
ffnord-con-2015-2/31c3/node.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"name": "31c3 Pattern",
|
||||||
|
"options": []
|
||||||
|
}
|
29
ffnord-con-2015-2/31c3/node.lua
Normal file
29
ffnord-con-2015-2/31c3/node.lua
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
gl.setup(NATIVE_WIDTH, NATIVE_HEIGHT)
|
||||||
|
|
||||||
|
sys.set_flag("slow_gc")
|
||||||
|
|
||||||
|
util.resource_loader{
|
||||||
|
"shader31c3.frag";
|
||||||
|
"noise.png";
|
||||||
|
"tiles.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
function node.render()
|
||||||
|
local now = sys.now()
|
||||||
|
|
||||||
|
local x = math.sin(now/62) * 320
|
||||||
|
local y = math.cos(now/128) * 200
|
||||||
|
|
||||||
|
gl.perspective(80 + math.cos(now/5) * 3, x + math.sin(now/14)*10, y + math.cos(now/14.4)*20, -100, x, y, 0)
|
||||||
|
gl.rotate(math.cos(now/9)*5, 0, 0, 1)
|
||||||
|
|
||||||
|
shader31c3:use{
|
||||||
|
time = now / 1234.5;
|
||||||
|
noise = noise;
|
||||||
|
tile_res = {16, 16};
|
||||||
|
res = {16.0 * 12, 16.0 * 12};
|
||||||
|
}
|
||||||
|
|
||||||
|
local size = 40
|
||||||
|
tiles:draw(-16*size, -16*size, 16*size, 16*size)
|
||||||
|
end
|
BIN
ffnord-con-2015-2/31c3/noise.png
Normal file
BIN
ffnord-con-2015-2/31c3/noise.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
6
ffnord-con-2015-2/31c3/package.json
Normal file
6
ffnord-con-2015-2/31c3/package.json
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"name": "Animated background pattern",
|
||||||
|
"author": "fw@dividuum.de",
|
||||||
|
"desc": "Background pattern created for the 31c3 conference in Hamburg",
|
||||||
|
"repository": "https://github.com/info-beamer/package-31c3-background"
|
||||||
|
}
|
BIN
ffnord-con-2015-2/31c3/package.png
Normal file
BIN
ffnord-con-2015-2/31c3/package.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
ffnord-con-2015-2/31c3/screenshot.jpg
Normal file
BIN
ffnord-con-2015-2/31c3/screenshot.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 KiB |
28
ffnord-con-2015-2/31c3/shader31c3.frag
Normal file
28
ffnord-con-2015-2/31c3/shader31c3.frag
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
uniform sampler2D Texture;
|
||||||
|
uniform sampler2D noise;
|
||||||
|
varying vec2 TexCoord;
|
||||||
|
uniform float time;
|
||||||
|
uniform vec2 res;
|
||||||
|
uniform vec2 tile_res;
|
||||||
|
|
||||||
|
const vec2 one = vec2(1.0, 1.0);
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 tcoord_res = TexCoord * res;
|
||||||
|
vec2 noise_vec1 = vec2(0.0, time * 0.8);
|
||||||
|
vec2 noise_vec2 = noise_vec1 + vec2(time * 0.9, 0.0);
|
||||||
|
|
||||||
|
vec2 pos = floor(tcoord_res) / res;
|
||||||
|
|
||||||
|
float foo = texture2D(noise, mod(pos * 41.0 + noise_vec1, one)).x;
|
||||||
|
float bar = texture2D(noise, mod(pos * 5.0 + noise_vec2, one)).x;
|
||||||
|
|
||||||
|
vec2 t = vec2(foo, bar);
|
||||||
|
t = floor(t * tile_res) / tile_res;
|
||||||
|
|
||||||
|
// gl_FragColor = vec4(t, 0.0, 1.0);
|
||||||
|
gl_FragColor = vec4(texture2D(
|
||||||
|
Texture,
|
||||||
|
mod(tcoord_res, one) / tile_res + t
|
||||||
|
).rgb, 1.0);
|
||||||
|
}
|
BIN
ffnord-con-2015-2/31c3/tiles.png
Normal file
BIN
ffnord-con-2015-2/31c3/tiles.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 235 KiB |
3
ffnord-con-2015-2/README
Normal file
3
ffnord-con-2015-2/README
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Animation für die ffnord->con2015.2 in Hamburg; zusammengeabaut aus Animationen vom 29c3 [ https://github.com/dividuum/info-beamer-nodes/tree/master/29c3-logo ] und 31c3 [ https://github.com/info-beamer/package-31c3-background ]
|
||||||
|
|
||||||
|
Die 31C3-logos im Hintergrund sollen noch gegen Freifunklogos getauscht werden.
|
6
ffnord-con-2015-2/node.lua
Normal file
6
ffnord-con-2015-2/node.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
gl.setup(1280, 720)
|
||||||
|
|
||||||
|
function node.render()
|
||||||
|
resource.render_child("31c3"):draw(0, 0, 1280, 720)
|
||||||
|
resource.render_child("29c3"):draw(0, 0, 1280, 720)
|
||||||
|
end
|
Loading…
Reference in a new issue