337 |
"color" : "0 0 0 0" } |
"color" : "0 0 0 0" } |
338 |
|
|
339 |
shape = self.shape |
shape = self.shape |
340 |
texscale = 1.0 |
texscale = 1 |
341 |
linewidth = 2 |
linewidth = 2 |
342 |
refsize = 128 |
refsize = 128 |
343 |
scale_pow = .5 |
scale_pow = .5 |
652 |
def key(self, k): |
def key(self, k): |
653 |
pass |
pass |
654 |
|
|
655 |
def __init__(self, type = 0, outer = 1, alphatest = 1, tex = 1, color = 1, inside = 1, xs = 600, ys = 600): |
def __init__(self, type = 0, outer = 1, alphatest = 1, tex = 1, color = 1, |
656 |
|
inside = 1, xs = 600, ys = 600, |
657 |
|
dice = 16, wireframe = 0, border = 1): |
658 |
self.type = type |
self.type = type |
659 |
self.outer = outer |
self.outer = outer |
660 |
self.alphatest = alphatest |
self.alphatest = alphatest |
663 |
self.color = color |
self.color = color |
664 |
self.xs = xs |
self.xs = xs |
665 |
self.ys = ys |
self.ys = ys |
666 |
|
self.dice = dice |
667 |
|
self.wireframe = wireframe |
668 |
|
self.border = border |
669 |
|
|
670 |
def scene(self, vs): |
def scene(self, vs): |
671 |
putnoc(vs, background((1.0,1.0,1.0))) |
putnoc(vs, background((1.0,1.0,1.0))) |
672 |
|
|
673 |
solid = 0 #XXX: draw solid instead of only edge |
solid = 1 #XXX: draw solid instead of only edge |
674 |
|
|
675 |
shape = 9 |
shape = 9 |
676 |
texscale = 1.3 |
texscale = 1.7 |
677 |
linewidth = 4 |
linewidth = 4 |
678 |
refsize = 128 |
refsize = 128 |
679 |
scale_pow = 0 |
scale_pow = 0 |
680 |
border0 = -.25 |
border0 = -.25 |
681 |
border1 = .25 |
border1 = .25 * self.border |
682 |
texslicing = 0.0 |
texslicing = 0.0 |
683 |
|
|
684 |
dice = 1.0 / 36 * 16 + 1E-5 |
dice = 1.0 / 36 * self.dice + 1E-5 |
685 |
|
|
686 |
code = stdcode |
code = stdcode |
687 |
|
|
748 |
|
|
749 |
cs1 = vs.coords.affineCoordsys(0, 10, |
cs1 = vs.coords.affineCoordsys(0, 10, |
750 |
self.xs*.5, self.ys*.5, |
self.xs*.5, self.ys*.5, |
751 |
self.xs * .4, 0, 0, self.ys * .4, |
self.xs * .33, 0, 0, self.ys * .33, |
752 |
) |
) |
753 |
|
|
754 |
vs.matcher.add(cs1, "1") |
vs.matcher.add(cs1, "1") |
762 |
|
|
763 |
vs.map.put(inner, cs1, cs2) |
vs.map.put(inner, cs1, cs2) |
764 |
|
|
765 |
|
if self.wireframe: |
766 |
|
vs.map.put( |
767 |
|
GLRen.createIrregularEdge( |
768 |
|
shape, |
769 |
|
texscale, linewidth, refsize, scale_pow, |
770 |
|
border0, border1, texslicing, "", "", |
771 |
|
0, 0, |
772 |
|
SLICE_2D, """ |
773 |
|
PushAttrib ENABLE_BIT POLYGON_BIT |
774 |
|
PolygonMode FRONT_AND_BACK LINE |
775 |
|
LineWidth 3 |
776 |
|
Disable TEXTURE_2D |
777 |
|
Disable ALPHA_TEST |
778 |
|
Disable DEPTH_TEST |
779 |
|
Color 0 0 0 |
780 |
|
""", dice), cs1, cs2) |
781 |
|
|
782 |
|
|
783 |
class StillMotionScene: |
class StillMotionScene: |
784 |
def __init__(self, type = 0, flag = 0): |
def __init__(self, type = 0, flag = 0): |
785 |
self.scale = 700 |
self.scale = 700 |
1010 |
|
|
1011 |
ps = ShapeScene(type = 0) |
ps = ShapeScene(type = 0) |
1012 |
r(ps, "shots/shape1Ddispl.png") |
r(ps, "shots/shape1Ddispl.png") |
1013 |
ps = ShapeScene(type = 0, outer = 0, inside = 0, color = 1, alphatest = 0, tex = 0) |
ps = ShapeScene(type = 0, outer = 0, inside = 0, color = 1, alphatest = 0, tex = 0, wireframe = 1) |
1014 |
r(ps, "shots/shape1Dcolor.png") |
r(ps, "shots/shape1Dcolor.png") |
1015 |
|
ps = ShapeScene(type = 0, outer = 0, inside = 0, color = 1, alphatest = 0, tex = 0, dice = 128, border = 2) |
1016 |
|
r(ps, "shots/shape1Dcolortex.png") |
1017 |
ps = ShapeScene(type = 0, outer = 0, inside = 0, color = 1, alphatest = 0, tex = 1) |
ps = ShapeScene(type = 0, outer = 0, inside = 0, color = 1, alphatest = 0, tex = 1) |
1018 |
r(ps, "shots/shape1Ddispltex_color.png") |
r(ps, "shots/shape1Ddispltex_color.png") |
1019 |
ps = ShapeScene(type = 0, outer = 0, inside = 0, color = 0, alphatest = 0, tex = 1) |
ps = ShapeScene(type = 0, outer = 0, inside = 0, color = 0, alphatest = 0, tex = 1) |
1020 |
r(ps, "shots/shape1Ddispltex.png") |
r(ps, "shots/shape1Ddispltex.png") |
1021 |
ps = ShapeScene(type = 1) |
ps = ShapeScene(type = 1, border = 2) |
1022 |
r(ps, "shots/shape1Doffset.png") |
r(ps, "shots/shape1Doffset.png") |
1023 |
ps = ShapeScene(type = 1, outer = 0, inside = 0, color = 1, alphatest = 0, tex = 1) |
ps = ShapeScene(type = 1, outer = 0, inside = 0, color = 1, alphatest = 0, tex = 1, border = 2) |
1024 |
r(ps, "shots/shape1Doffsettex_color.png") |
r(ps, "shots/shape1Doffsettex_color.png") |
1025 |
ps = ShapeScene(type = 1, outer = 0, inside = 0, color = 0, alphatest = 0, tex = 1) |
ps = ShapeScene(type = 1, outer = 0, inside = 0, color = 0, alphatest = 0, tex = 1, border = 2) |
1026 |
r(ps, "shots/shape1Doffsettex.png") |
r(ps, "shots/shape1Doffsettex.png") |
1027 |
ps = ShapeScene(type = 2) |
ps = ShapeScene(type = 2, border = 2) |
1028 |
r(ps, "shots/shape2D.png") |
r(ps, "shots/shape2D.png") |
1029 |
ps = ShapeScene(type = 2, outer = 0) |
ps = ShapeScene(type = 2, outer = 0, border = 2) |
1030 |
r(ps, "shots/shape2Dorig.png") |
r(ps, "shots/shape2Dorig.png") |
1031 |
|
|
1032 |
currentScene = IrreguScene() |
currentScene = IrreguScene() |
1033 |
|
|
|
#currentScene = ShapeScene(type = 2, outer = 0) |
|
|
|
|
1034 |
#currentScene = StillMotionScene(type = 1, flag = 1) |
#currentScene = StillMotionScene(type = 1, flag = 1) |
1035 |
|
|
1036 |
#GL.call("PolygonMode FRONT_AND_BACK FILL") |
#GL.call("PolygonMode FRONT_AND_BACK FILL") |