/[gzz]/gzz/gfx/libpaper/textures.py
ViewVC logotype

Diff of /gzz/gfx/libpaper/textures.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by jvk, Mon Oct 7 12:43:23 2002 UTC revision 1.15 by jvk, Mon Oct 7 14:22:25 2002 UTC
# Line 17  isNV2X = 0 Line 17  isNV2X = 0
17    
18  ptextures = {}  ptextures = {}
19    
   
20  # XXX: where should this code be? --------------  # XXX: where should this code be? --------------
21  from gzz.gfx.gl import GL  from gzz.gfx.gl import GL
22  from gfx.libutil.myimport import get_file_ctime  from gfx.libutil.myimport import get_file_ctime
# Line 69  class NamedTexture: Line 68  class NamedTexture:
68    
69  tres = 128  tres = 128
70    
71  ptextures["RGB2"] = [  initialized = 0
72  apply(NamedTexture, i) for i in [  def init():
73      ("rgbw1", [tres, tres, 0, 3, "RGB", "RGB",      global initialized
74            "fnoise", ["scale", "2.5", "freq", "1", "df", "2", "bias", "0.5"]]),      initialized = 1
75      ("rgbw2", [tres, tres, 0, 3, "RGB", "RGB",      global ptextures
76            "fnoise", ["scale", ".43", "freq", "1", "df", "2", "bias", "0.5", "seed", "1412"]]),      ptextures["RGB2"] = [
77            apply(NamedTexture, i) for i in [
78      ("turb", [tres, tres, 0, 3, "RGB", "RGB",          ("rgbw1", [tres, tres, 0, 3, "RGB", "RGB",
79                "fnoise", ["turb", "1", "scale", ".3", "freq", "1", "freq2", "100", "df", "2", "bias", "0"]]),                     "fnoise", ["scale", "2.5", "freq", "1", "df", "2", "bias", "0.5"]]),
80            ("rgbw2", [tres, tres, 0, 3, "RGB", "RGB",
81      ("pyramid", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "0"]]),                     "fnoise", ["scale", ".43", "freq", "1", "df", "2", "bias", "0.5", "seed", "1412"]]),
82      ("checkerboard", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "1"]]),          
83      ("cone", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "2"]]),          ("turb", [tres, tres, 0, 3, "RGB", "RGB",
84      ("checkerboard2", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "3"]]),                    "fnoise", ["turb", "1", "scale", ".3", "freq", "1", "freq2", "100", "df", "2", "bias", "0"]]),
85  ]]          
86            ("pyramid", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "0"]]),
87            ("checkerboard", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "1"]]),
88            ("cone", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "2"]]),
89            ("checkerboard2", [64, 64, 0, 3, "RGB", "RGB", "geometric", ["type", "3"]]),
90            ]]
91        
92  def getPaperTexture(type, gen):  def getPaperTexture(type, gen):
93      return selectRandom(ptextures[type], gen)      return selectRandom(ptextures[type], gen)
94    
95    
96  class Textures:  class Textures:
97      def __init__(self, seed):      def __init__(self, seed):
98            if not initialized: init()
99            
100          rnd = java.util.Random(seed)          rnd = java.util.Random(seed)
101    
102          hyper = rnd.nextGaussian()*5          hyper = rnd.nextGaussian()*5

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26