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

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

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

revision 1.50 by jvk, Tue Oct 15 12:03:48 2002 UTC revision 1.51 by jvk, Tue Oct 15 13:52:04 2002 UTC
# Line 64  else: Line 64  else:
64            
65  dbg = 0  dbg = 0
66    
 def randvec(rnd): return [rnd.nextDouble() for i in range(0,3)]  
   
 def randunitvec(rnd):  
     x = 2 * rnd.nextDouble() - 1  
     y = 2 * rnd.nextDouble() - 1  
     z = 2 * rnd.nextDouble() - 1  
     m = 1./Math.sqrt(x*x+y*y+z*z)*.5  
     return [m * x + .5, m * y + .5, m * z + .5]  
   
   
67  def selectRandom(list, gen):  def selectRandom(list, gen):
68      return list[gen.nextInt(len(list))]      return list[gen.nextInt(len(list))]
69    
 def selectDet(list, type):  
     return ( list[type % len(list)], type / len(list) )  
   
70  def setSolidPass(pas, color):  def setSolidPass(pas, color):
71      pas.setSetupcode("""      pas.setSetupcode("""
72          PushAttrib ENABLE_BIT TEXTURE_BIT          PushAttrib ENABLE_BIT TEXTURE_BIT
# Line 200  class ThePaperMill(PaperMill): Line 187  class ThePaperMill(PaperMill):
187              """              """
188                                    
189          code += (          code += (
190              sh.setupCode() +              sh.setupCode(rnd) +
191              comb.setupCode(sh.getRGBoutputs(), sh.getRGBoutputscales(), colors, rnd, trans)              comb.setupCode(sh.getRGBoutputs(), sh.getRGBoutputscales(), colors, rnd, trans)
192          )          )
193    

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

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