fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] libvob/vob/fillet light3d.py


From: Janne V. Kujala
Subject: [ff-cvs] libvob/vob/fillet light3d.py
Date: Tue, 19 Aug 2003 04:36:46 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/08/19 04:36:46

Modified files:
        vob/fillet     : light3d.py 

Log message:
        toggle filleting

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.36&tr2=1.37&r1=text&r2=text

Patches:
Index: libvob/vob/fillet/light3d.py
diff -u libvob/vob/fillet/light3d.py:1.36 libvob/vob/fillet/light3d.py:1.37
--- libvob/vob/fillet/light3d.py:1.36   Fri Aug 15 05:52:11 2003
+++ libvob/vob/fillet/light3d.py        Tue Aug 19 04:36:46 2003
@@ -130,6 +130,26 @@
 }
 
 """, "arbvp1")),
+GL.createProgram(cg.compile("""
+void main(
+    float4 pos: POSITION,
+    float4 tex0: TEXCOORD0,
+    float4 col: COLOR,
+    out float4 opos: POSITION,
+    out float4 ocol: COLOR,
+    out float4 otex0: TEXCOORD0
+) {
+    opos = mul(glstate.matrix.mvp, pos);
+    float3 defaultcolor = float3(.2, .2, 1);
+    float t = (1 - tex0.z);
+    ocol.rgb = lerp(defaultcolor, col, t * t);
+    ocol.a = 1;
+
+    otex0 = tex0 * float4(20, 20, 0, 1);
+}
+
+""", "arbvp1")),
+
 ]
 
 edgefp = GL.createProgram(cg.compile("""
@@ -311,11 +331,15 @@
 
         conns3dblend = GLRen.createFillet3DBlend(self.dice, self.dicelen, 
self.tblsize, self.mode);
 
-        thick = vs.coords.rational1D22(0, .5 * self.thick, 0, 0,  1, 1, 0);
-        angle = vs.coords.rational1D22(0, self.angle, 0, 0,  1, 0, 0);
-
-        thick = vs.coords.rational1D22(0, 2*self.thick, self.thick, 0, 2, 1, 
1);
-        angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);
+        if self.fillets:
+            thick = vs.coords.rational1D22(0, .5 * self.thick, 0, 0,  1, 1, 0);
+            angle = vs.coords.rational1D22(0, self.angle, 0, 0,  1, 0, 0);
+
+            thick = vs.coords.rational1D22(0, 2*self.thick, self.thick, 0, 2, 
1, 1);
+            angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);
+        else:
+            thick = vs.coords.power1D2(0, .15 * self.thick, 0, 0, 0)
+            angle = vs.coords.power1D2(0, 0, 1/3., 0, -1)
 
         vs.matcher.add(thick, "Thi")
         vs.matcher.add(angle, "Ang")
@@ -329,12 +353,7 @@
             PushMatrix
             MatrixMode MODELVIEW
             PushMatrix
-            """ % vp[0].getProgId()))
-
-           if not self.depthColor:
-               vs.put(getDListNocoords("""
-               Disable VERTEX_PROGRAM_ARB
-               """))
+            """ % vp[not self.depthColor].getProgId()))
 
             if self.texture:
                 vs.put(getDListNocoords("""
@@ -358,11 +377,11 @@
                 uLookAt 400 400 -1000 400 400 400 0 -1 0
                 """))
 
-            if self.blend3d:
+            if self.blend3d and self.fillets:
                 vs.put(getDListNocoords("Color .2 .2 1"))
                 pc(conns3dblend, [thick, angle])
 
-            if self.drawInside:
+            if self.drawInside or not self.fillets:
                 vs.put(getDListNocoords("Color .2 .2 1"))
                 pc(conns3d, [thick, angle])
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]