/[gzz]/gzz/gfx/demo/irregu3.py
ViewVC logotype

Diff of /gzz/gfx/demo/irregu3.py

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

revision 1.20 by jvk, Fri Oct 25 09:17:53 2002 UTC revision 1.21 by jvk, Fri Oct 25 10:39:06 2002 UTC
# Line 5  from gfx.libpaper.texcache import getCac Line 5  from gfx.libpaper.texcache import getCac
5  ripple_scale = .25  ripple_scale = .25
6  size = 256  size = 256
7  lodbias = 0  lodbias = 0
8    texscale = 1
9  use_texture = 0  use_texture = 0
10    
11  matrices = [ "1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1",  matrices = [ "1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1",
# Line 147  def globalkey(k): Line 147  def globalkey(k):
147      elif k == "t":      elif k == "t":
148          global use_texture          global use_texture
149          use_texture = not use_texture          use_texture = not use_texture
150                global lodbias
151        if k == "b": lodbias += .25; print "lodbias", lodbias
152        elif k == "B": lodbias -= .25; print "lodbias", lodbias
153        global texscale
154        if k == "s": texscale *= 1.2; print "texscale", texscale
155        elif k == "S": texscale /= 1.2; print "texscale", texscale
156    
157    
158  # alpha(y) = e / y * f >= e  # alpha(y) = e / y * f >= e
# Line 292  class IrreguScene: Line 297  class IrreguScene:
297          cs3 = vs.coords.affineCoordsys(0, 0, 512, 384, self.scale, 0, 0, self.scale)          cs3 = vs.coords.affineCoordsys(0, 0, 512, 384, self.scale, 0, 0, self.scale)
298          vs.matcher.add(cs3, "3")          vs.matcher.add(cs3, "3")
299    
300          texscale = 1          #texscale = 1
301    
302          x0 = -1 - 0.5 * ripple_scale * texscale          x0 = -1 - 0.5 * ripple_scale * texscale
303          x1 = 1 + 0.5 * ripple_scale * texscale          x1 = 1 + 0.5 * ripple_scale * texscale
# Line 378  class IrreguScene: Line 383  class IrreguScene:
383          if k == "Left": self.tx -= .1          if k == "Left": self.tx -= .1
384          if k == "Right": self.tx += .1          if k == "Right": self.tx += .1
385                    
         global lodbias  
         if k == "b": lodbias += .25; print "lodbias", lodbias  
         if k == "B": lodbias -= .25; print "lodbias", lodbias  
           
386    
387  currentScene = IrreguScene()          currentScene = IrreguScene()        

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

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