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

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

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

revision 1.24 by jvk, Sat Nov 30 09:23:57 2002 UTC revision 1.25 by jvk, Sat Nov 30 10:06:37 2002 UTC
# Line 575  class IrreguScene: Line 575  class IrreguScene:
575    
576    
577  class StillMotionScene:  class StillMotionScene:
578      stdcode = """      def __init__(self):
579            self.scale = 512
580            self.x0, self.y0 = -.35, -.65
581            self.x1, self.y1 = .35, .65
582            self.xs, self.ys = .6,.4
583            self.a1 = 0
584    
585            stdcode = """
586          PushAttrib ENABLE_BIT TEXTURE_BIT CURRENT_BIT          PushAttrib ENABLE_BIT TEXTURE_BIT CURRENT_BIT
587          BindTexture TEXTURE_2D %s          BindTexture TEXTURE_2D %s
588          TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR          TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
589          TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR          TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
590          Enable TEXTURE_2D          Enable TEXTURE_2D
591          TexEnv TEXTURE_ENV TEXTURE_ENV_MODE ADD          TexEnv TEXTURE_ENV TEXTURE_ENV_MODE ADD
592            TexEnv TEXTURE_FILTER_CONTROL_EXT TEXTURE_LOD_BIAS_EXT 3
593          Enable ALPHA_TEST          Enable ALPHA_TEST
594          AlphaFunc GEQUAL 1.0          AlphaFunc GEQUAL 1.0
595          """ % texINTENSITY.getTexId()          """ % texINTENSITY.getTexId()
596    
597            
598      shape = 0          shape = 10
599      texscale = 3          texscale = 1
600      linewidth = 4          linewidth = 4
601      refsize = 128          refsize = 128
602      scale_pow = 0          scale_pow = 0
603      border0 = -.5 * ripple_scale * texscale          border0 = -.5 * ripple_scale * texscale
604      border1 = .5 * ripple_scale * texscale          border1 = .5 * ripple_scale * texscale
605      texslicing = 0.0          texslicing = 0.0
606    
607      inner =  GLRen.createIrregularEdge(          self.inner =  GLRen.createIrregularEdge(
608          shape, texscale, linewidth, refsize, scale_pow,              shape, texscale, linewidth, refsize, scale_pow,
609          border0, border1, texslicing,              border0, border1, texslicing,
610          "0 0 0 1 0 0 0 0", "", 0, 0, SLICE_1D + Y_COLOR + INSIDE,              "0 0 0 1 0 0 0 0", "", 0, 0, SLICE_1D + Y_COLOR + INSIDE,
611          stdcode, 1.0)              stdcode, 1.0)
612      outer = GLRen.createIrregularEdge(          self.outer = GLRen.createIrregularEdge(
613          shape, texscale, linewidth, refsize, scale_pow,              shape, texscale, linewidth, refsize, scale_pow,
614          border0, border1, texslicing,              border0, border1, texslicing,
615          "0 0 0 1 0 0 0 0", "", 0, 0, SLICE_1D + Y_COLOR + SHIFTS + INSIDE,              "0 0 0 1 0 0 0 0", "", 0, 0, SLICE_1D + Y_COLOR + SHIFTS + INSIDE,
616          stdcode, 1.0)              stdcode, 1.0)
617      envelope = GLRen.createIrregularEdge(          self.envelope = GLRen.createIrregularEdge(
618          shape, texscale, linewidth, refsize, scale_pow,              shape, texscale, linewidth, refsize, scale_pow,
619          border0, border1, texslicing,              border0, border1, texslicing,
620          "", "", 0, 0, SLICE_2D + INSIDE,              "", "", 0, 0, SLICE_2D + INSIDE,
621          """              """
622          PushAttrib              PushAttrib
623          Disable TEXTURE_2D              Disable TEXTURE_2D
624          """, 1.0)              """, 1.0)
625            
626      canvas = getDList("""          self.canvas = getDList("""
627      Enable BLEND          Enable BLEND
628      Disable ALPHA_TEST          Disable ALPHA_TEST
629      BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA          BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
630      LineWidth %s          LineWidth %s
631      Begin LINES          Begin LINES
632      Vertex -4 -4          Vertex -1 -1
633      Vertex -4 +4          Vertex -1 +1
634            
635      Vertex +4 -4          Vertex +1 -1
636      Vertex +4 +4          Vertex +1 +1
637            
638      Vertex -4 -4          Vertex -1 -1
639      Vertex +4 -4          Vertex +1 -1
640            
641      Vertex -4 +4          Vertex -1 +1
642      Vertex +4 +4          Vertex +1 +1
643      End          End
644      Color 0 0 0 0          Color 0 0 0 0
645      Begin QUAD_STRIP          Begin QUAD_STRIP
646      Vertex -4 -4          Vertex -1 -1
647      Vertex -4 +4          Vertex -1 +1
648      Vertex +4 -4          Vertex +1 -1
649      Vertex +4 +4          Vertex +1 +1
650      End          End
651      """ % linewidth)          """ % linewidth)
652    
     def __init__(self):  
         self.scale = 256  
         self.x0, self.y0 = 2,0  
         self.x1, self.y1 = -2.5,0  
         self.xs, self.ys = 2,1  
         self.a1 = 0  
653    
654      def putedge(self, vs, cs1, cs2, alpha):      def putedge(self, vs, cs1, cs2, alpha):
655          vs.map.put(Depth.mask0)          vs.map.put(Depth.mask0)
# Line 689  class StillMotionScene: Line 691  class StillMotionScene:
691          for i in 0,1,2,3:          for i in 0,1,2,3:
692                            
693              cs2 = vs.coords.affineCoordsys(              cs2 = vs.coords.affineCoordsys(
694                  0, 0, self.x1 + .15 * i, self.y1,                  0, 0, self.x1 + .02 * i, self.y1,
695                  self.xs * cos(self.a1), self.ys * -sin(self.a1),                  self.xs * cos(self.a1), self.ys * -sin(self.a1),
696                  self.xs * sin(self.a1), self.ys * cos(self.a1) )                  self.xs * sin(self.a1), self.ys * cos(self.a1) )
697    
698              vs.matcher.add(cs2, "2." + str(i))              vs.matcher.add(cs2, "2." + str(i))
699    
700              self.putedge(vs, cs1, cs2, (1, .6, .3, .2)[i])              self.putedge(vs, cs1, cs2, (.2, .3, .6, 1)[i])
701    
702    
703  def r(sc, filename):  def r(sc, filename):

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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