12 |
tres = 128 |
tres = 128 |
13 |
args = [ |
args = [ |
14 |
[tres, tres, 0, 3, "RGB", "RGB", "fnoise", |
[tres, tres, 0, 3, "RGB", "RGB", "fnoise", |
15 |
["scale", ".43", "freq", ".75", "df", "1", "bias", "0.5", "seed", "2323" ]], |
["scale", ".43", "freq", ".75", "df", "1", "bias", "0.5", |
16 |
|
"seed", "2323" ]], |
17 |
|
|
18 |
[tres, tres, 0, 3, "RGB", "RGB", "fnoise", |
[tres, tres, 0, 3, "RGB", "RGB", "fnoise", |
19 |
["scale", ".43", "freq", "1", "df", "1.5", "bias", "0.5" ]], |
["scale", ".43", "freq", "1", "df", "1.5", "bias", "0.5" ]], |
|
[tres, tres, 0, 3, "RGB", "RGB", "fnoise", |
|
|
["scale", ".43", "freq", "1", "df", "5", "bias", "0.5", |
|
|
"seed", "141", "aniso", "2"]], |
|
20 |
|
|
21 |
[tres, tres, 0, 4, "RGBA", "RGBA", "fnoise", |
[tres, tres, 0, 3, "RGB", "RGB", "fnoise", |
22 |
["scale", ".43", "freq", "1", "df", "1.5", "bias", "0.5" ]], |
["scale", ".3", "freq", "1", "df", "1.9", "bias", "0.5", |
23 |
|
"seed", "361", "aniso", "2"]], |
24 |
|
|
25 |
[tres, tres, 0, 4, "RGBA", "RGBA", "fnoise", |
[tres, tres, 0, 3, "RGB", "RGB", "fnoise", |
|
["scale", ".43", "freq", "1", "df", "8", "bias", "0.5", |
|
|
"seed", "141", "aniso", "2"]], |
|
|
[tres, tres, 0, 4, "RGBA", "RGBA", "fnoise", |
|
26 |
["turb", "1", "scale", ".3", "freq", "1", |
["turb", "1", "scale", ".3", "freq", "1", |
27 |
"freq2", "100", "df", "1", "bias", "0"]], |
"freq2", "100", "df", "1", "bias", "0"]], |
28 |
|
|
29 |
[64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "0"]], |
[64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "0"]], |
30 |
[64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "1"]], |
[64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "1"]], |
31 |
[64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "2"]], |
[64, 64, 0, 4, "RGBA", "RGBA", "geometric", ["type", "2"]], |
38 |
from gfx.libpaper.textures import getCachedTexture |
from gfx.libpaper.textures import getCachedTexture |
39 |
|
|
40 |
|
|
41 |
|
if not globals().has_key("ind"): ind = 0 |
42 |
|
|
43 |
class TexLabScene: |
class TexLabScene: |
44 |
def __init__(self): |
def __init__(self): |
|
self.ind = 0 |
|
45 |
if not globals().has_key("tex"): self.inittex() |
if not globals().has_key("tex"): self.inittex() |
46 |
|
|
47 |
def inittex(self): |
def inittex(self): |
48 |
global tex |
global tex |
49 |
tex = getCachedTexture(args[self.ind]) |
tex = getCachedTexture(args[ind % len(args)]) |
50 |
|
|
51 |
def key(self, k): |
def key(self, k): |
52 |
reinit = 0 |
reinit = 0 |
53 |
if k == "+": self.ind = (self.ind+1) % len(args); reinit=1 |
global ind |
54 |
if k == "-": self.ind = (self.ind+len(args)-1) % len(args); reinit=1 |
if k == "+": ind = (ind+1) % len(args); reinit=1 |
55 |
|
if k == "-": ind = (ind+len(args)-1) % len(args); reinit=1 |
56 |
|
if k == "0": reinit=1 |
57 |
|
|
58 |
if reinit: |
if reinit: |
59 |
self.inittex() |
self.inittex() |
60 |
print "Texture", self.ind |
print "Texture", ind |
61 |
|
|
62 |
pass |
pass |
63 |
|
|