/[libvob]/libvob/vob/fillet/light3d.py
ViewVC logotype

Diff of /libvob/vob/fillet/light3d.py

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

revision 1.36 by jvk, Fri Aug 15 09:52:11 2003 UTC revision 1.37 by jvk, Tue Aug 19 08:36:46 2003 UTC
# Line 130  void main( Line 130  void main(
130  }  }
131    
132  """, "arbvp1")),  """, "arbvp1")),
133    GL.createProgram(cg.compile("""
134    void main(
135        float4 pos: POSITION,
136        float4 tex0: TEXCOORD0,
137        float4 col: COLOR,
138        out float4 opos: POSITION,
139        out float4 ocol: COLOR,
140        out float4 otex0: TEXCOORD0
141    ) {
142        opos = mul(glstate.matrix.mvp, pos);
143        float3 defaultcolor = float3(.2, .2, 1);
144        float t = (1 - tex0.z);
145        ocol.rgb = lerp(defaultcolor, col, t * t);
146        ocol.a = 1;
147    
148        otex0 = tex0 * float4(20, 20, 0, 1);
149    }
150    
151    """, "arbvp1")),
152    
153  ]  ]
154    
155  edgefp = GL.createProgram(cg.compile("""  edgefp = GL.createProgram(cg.compile("""
# Line 311  def drawFillets(self, vs, pc): Line 331  def drawFillets(self, vs, pc):
331    
332          conns3dblend = GLRen.createFillet3DBlend(self.dice, self.dicelen, self.tblsize, self.mode);          conns3dblend = GLRen.createFillet3DBlend(self.dice, self.dicelen, self.tblsize, self.mode);
333    
334          thick = vs.coords.rational1D22(0, .5 * self.thick, 0, 0,  1, 1, 0);          if self.fillets:
335          angle = vs.coords.rational1D22(0, self.angle, 0, 0,  1, 0, 0);              thick = vs.coords.rational1D22(0, .5 * self.thick, 0, 0,  1, 1, 0);
336                angle = vs.coords.rational1D22(0, self.angle, 0, 0,  1, 0, 0);
337          thick = vs.coords.rational1D22(0, 2*self.thick, self.thick, 0, 2, 1, 1);  
338          angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);              thick = vs.coords.rational1D22(0, 2*self.thick, self.thick, 0, 2, 1, 1);
339                angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);
340            else:
341                thick = vs.coords.power1D2(0, .15 * self.thick, 0, 0, 0)
342                angle = vs.coords.power1D2(0, 0, 1/3., 0, -1)
343    
344          vs.matcher.add(thick, "Thi")          vs.matcher.add(thick, "Thi")
345          vs.matcher.add(angle, "Ang")          vs.matcher.add(angle, "Ang")
# Line 329  def drawFillets(self, vs, pc): Line 353  def drawFillets(self, vs, pc):
353              PushMatrix              PushMatrix
354              MatrixMode MODELVIEW              MatrixMode MODELVIEW
355              PushMatrix              PushMatrix
356              """ % vp[0].getProgId()))              """ % vp[not self.depthColor].getProgId()))
   
             if not self.depthColor:  
                 vs.put(getDListNocoords("""  
                 Disable VERTEX_PROGRAM_ARB  
                 """))  
357    
358              if self.texture:              if self.texture:
359                  vs.put(getDListNocoords("""                  vs.put(getDListNocoords("""
# Line 358  def drawFillets(self, vs, pc): Line 377  def drawFillets(self, vs, pc):
377                  uLookAt 400 400 -1000 400 400 400 0 -1 0                  uLookAt 400 400 -1000 400 400 400 0 -1 0
378                  """))                  """))
379    
380              if self.blend3d:              if self.blend3d and self.fillets:
381                  vs.put(getDListNocoords("Color .2 .2 1"))                  vs.put(getDListNocoords("Color .2 .2 1"))
382                  pc(conns3dblend, [thick, angle])                  pc(conns3dblend, [thick, angle])
383    
384              if self.drawInside:              if self.drawInside or not self.fillets:
385                  vs.put(getDListNocoords("Color .2 .2 1"))                  vs.put(getDListNocoords("Color .2 .2 1"))
386                  pc(conns3d, [thick, angle])                  pc(conns3d, [thick, angle])
387    

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

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