1 |
from gfx.libutil.nvcode import combinercode, parseCombiner |
from gfx.libutil.nvcode import combinercode, parseCombiner |
2 |
from gfx.libpaper.texcache import getCachedTexture |
from gfx.libpaper.texcache import getCachedTexture |
3 |
from math import sin,cos |
from math import sin,cos,pi |
4 |
from gfx.libutil import saveanim |
from gfx.libutil import saveanim |
5 |
|
|
6 |
|
|
280 |
self.shape = 0 |
self.shape = 0 |
281 |
self.texslicing = 0 |
self.texslicing = 0 |
282 |
self.flags = 127 |
self.flags = 127 |
283 |
|
self.texscale = 1 |
284 |
|
|
285 |
self.initcode() |
self.initcode() |
286 |
|
|
338 |
"color" : "0 0 0 0" } |
"color" : "0 0 0 0" } |
339 |
|
|
340 |
shape = self.shape |
shape = self.shape |
341 |
texscale = 1 |
texscale = self.texscale |
342 |
linewidth = 2 |
linewidth = 2 |
343 |
refsize = 128 |
refsize = 128 |
344 |
scale_pow = .5 |
scale_pow = .5 |
477 |
0, 0, |
0, 0, |
478 |
slice + Y_COLOR + (self.flags >> 4 & 1) * INSIDE, code, 1.0) |
slice + Y_COLOR + (self.flags >> 4 & 1) * INSIDE, code, 1.0) |
479 |
|
|
480 |
if GL.hasExtension("GL_NV_register_combiners") and 1: |
if GL.hasExtension("GL_NV_register_combiners") and 0: |
481 |
self.outer = GLRen.createIrregularEdge(shape, |
self.outer = GLRen.createIrregularEdge(shape, |
482 |
texscale, linewidth, refsize, scale_pow, |
texscale, linewidth, refsize, scale_pow, |
483 |
border0, border1, texslicing, |
border0, border1, texslicing, |
954 |
self.scale * 1) |
self.scale * 1) |
955 |
vs.matcher.add(cs1, "1") |
vs.matcher.add(cs1, "1") |
956 |
|
|
957 |
for i in range(0,5): |
n = 9 |
958 |
|
for i in range(0,n): |
959 |
|
|
960 |
cs2 = vs.coords.affineCoordsys( |
cs2 = vs.coords.affineCoordsys( |
961 |
0, 0, self.x1 + .02 * i, self.y1, |
0, 0, self.x1 + .02 * i, self.y1, |
964 |
|
|
965 |
vs.matcher.add(cs2, "2." + str(i)) |
vs.matcher.add(cs2, "2." + str(i)) |
966 |
|
|
967 |
alpha = (.2, .4, .6, .8, 1)[i] |
alpha = .3 + .7 * i / (n - 1.0) |
968 |
if self.flag: |
if self.flag: |
969 |
self.putedge2(vs, cs1, cs2, alpha) |
self.putedge2(vs, cs1, cs2, alpha) |
970 |
else: |
else: |
975 |
vs = w.createVobScene() |
vs = w.createVobScene() |
976 |
sc.scene(vs) |
sc.scene(vs) |
977 |
w.renderStill(vs, 0) |
w.renderStill(vs, 0) |
978 |
saveanim.saveframe(filename, w) |
#saveanim.saveframe(filename, w) |
979 |
|
|
980 |
def makeScreenshots(): |
def makeScreenshots(): |
981 |
|
|
989 |
# other parameters are hardcoded |
# other parameters are hardcoded |
990 |
# with if's in StillMotionScene class |
# with if's in StillMotionScene class |
991 |
|
|
992 |
if 1: |
if 0: |
993 |
w.setLocation(0,0,1024,768) |
w.setLocation(0,0,1024,768) |
994 |
## pre-computed angles |
## pre-computed angles |
995 |
#ps = StillMotionScene(type = "0b", flag = 1) |
#ps = StillMotionScene(type = "0b", flag = 1) |
997 |
|
|
998 |
#ps = StillMotionScene(type = 0) |
#ps = StillMotionScene(type = 0) |
999 |
#r(ps, "shots/motion.png") |
#r(ps, "shots/motion.png") |
1000 |
ps = StillMotionScene(type = 1) |
ps = StillMotionScene(type = 1, flag = 1) |
1001 |
r(ps, "shots/motion.png") |
r(ps, "shots/motion.png") |
1002 |
|
|
1003 |
#ps = StillMotionScene(type = 0, flag = 1) |
#ps = StillMotionScene(type = 0, flag = 1) |
1034 |
ps = ShapeScene(type = 2, outer = 0, border = 2) |
ps = ShapeScene(type = 2, outer = 0, border = 2) |
1035 |
r(ps, "shots/shape2Dorig.png") |
r(ps, "shots/shape2Dorig.png") |
1036 |
|
|
1037 |
|
|
1038 |
|
if 1: |
1039 |
|
frame = 0 |
1040 |
|
ps = IrreguScene() |
1041 |
|
w.setLocation(0,0,1024,768) |
1042 |
|
|
1043 |
|
global ripple_scale |
1044 |
|
ripple_scale = .5 |
1045 |
|
|
1046 |
|
ps.texscale = 1.2 |
1047 |
|
ps.xs = 1.3 |
1048 |
|
ps.ys = 1.3 |
1049 |
|
ps.shape = 8 |
1050 |
|
ps.texslicing = 1 |
1051 |
|
ps.initcode() |
1052 |
|
|
1053 |
|
|
1054 |
|
N = 600 |
1055 |
|
for i in range(0,N): |
1056 |
|
|
1057 |
|
a = i / float(N) * 2 * pi |
1058 |
|
|
1059 |
|
#ps.x0 = cos(a) |
1060 |
|
#ps.y0 = sin(a) |
1061 |
|
ps.x1 = -cos(a) |
1062 |
|
ps.y1 = -sin(a) |
1063 |
|
|
1064 |
|
if i == N: |
1065 |
|
ps.shape = 9 |
1066 |
|
ripple_scale = .3 |
1067 |
|
ps.texslicing = 0 |
1068 |
|
ps.initcode() |
1069 |
|
|
1070 |
|
#global paperquad |
1071 |
|
#seed = 201 |
1072 |
|
#pap = ThePaperMill().getPaper(seed) |
1073 |
|
#paperquad = GLRen.createPaperQuad(pap, -4, -4, 4, 4, 0) |
1074 |
|
|
1075 |
|
|
1076 |
|
r(ps, "tmpfilm/irregu%03i.jpg" % frame); frame += 1; |
1077 |
|
|
1078 |
|
#saveanim.encodefilm("tmpfilm/irregu\\*.jpg", "irregufilm.avi") |
1079 |
|
|
1080 |
|
|
1081 |
|
|
1082 |
currentScene = IrreguScene() |
currentScene = IrreguScene() |
1083 |
|
|
1084 |
#currentScene = StillMotionScene(type = 1, flag = 1) |
#currentScene = StillMotionScene(type = 1, flag = 1) |