gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob include/vob/FisheyePrimitives.hxx org/no...


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob include/vob/FisheyePrimitives.hxx org/no...
Date: Thu, 27 Mar 2003 06:04:53 -0500

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Tuomas J. Lukka <address@hidden>        03/03/27 06:04:53

Modified files:
        include/vob    : FisheyePrimitives.hxx 
        org/nongnu/libvob/buoy: buoymanager.py 
        org/nongnu/libvob/view: FisheyeState.java 
        test/vob/gl    : glvobcoorder.test 

Log message:
        CRUCIAL fixes to distort coordsys and fisheye

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/FisheyePrimitives.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/buoymanager.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/view/FisheyeState.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/test/vob/gl/glvobcoorder.test.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: libvob/include/vob/FisheyePrimitives.hxx
diff -u libvob/include/vob/FisheyePrimitives.hxx:1.1 
libvob/include/vob/FisheyePrimitives.hxx:1.2
--- libvob/include/vob/FisheyePrimitives.hxx:1.1        Thu Mar 27 02:51:17 2003
+++ libvob/include/vob/FisheyePrimitives.hxx    Thu Mar 27 06:04:52 2003
@@ -127,10 +127,10 @@
        template<class Ptr> void setParams(Ptr p) {
            x = p[0];
            y = p[1];
-           mmax = exp(p[2]);
-           mmin = exp(p[3]);
-           w = p[4];
-           h = p[5];
+           w = p[2];
+           h = p[3];
+           mmax = exp(p[4]);
+           mmin = exp(p[5]);
            distort.setMag(mmax / mmin);
            iaminverse = false;
        }
Index: libvob/org/nongnu/libvob/buoy/buoymanager.py
diff -u libvob/org/nongnu/libvob/buoy/buoymanager.py:1.2 
libvob/org/nongnu/libvob/buoy/buoymanager.py:1.3
--- libvob/org/nongnu/libvob/buoy/buoymanager.py:1.2    Thu Mar 27 02:51:17 2003
+++ libvob/org/nongnu/libvob/buoy/buoymanager.py        Thu Mar 27 06:04:52 2003
@@ -165,7 +165,7 @@
         if key == "Print":
             saveanim.saveframe("buoyoing.png", w)
             
-       gzz.client.AbstractUpdateManager.chg()
+       vob.AbstractUpdateManager.chg()
        pass
 
     def mouse(self, ev):
@@ -177,14 +177,14 @@
        if link == None:
            if self.mainNode.mouse(ev, self.vs):
                replaceNewScene(self.vs)
-               gzz.client.AbstractUpdateManager.setNoAnimation()
-               gzz.client.AbstractUpdateManager.chg()
+               vob.AbstractUpdateManager.setNoAnimation()
+               vob.AbstractUpdateManager.chg()
        else:
             if ev.getID() != ev.MOUSE_CLICKED:
                 return
 
             self.followLink(link)
-            gzz.client.AbstractUpdateManager.chg()
+            vob.AbstractUpdateManager.chg()
 
            
     def followLink(self, link):
Index: libvob/org/nongnu/libvob/view/FisheyeState.java
diff -u libvob/org/nongnu/libvob/view/FisheyeState.java:1.1 
libvob/org/nongnu/libvob/view/FisheyeState.java:1.2
--- libvob/org/nongnu/libvob/view/FisheyeState.java:1.1 Thu Mar 27 03:27:17 2003
+++ libvob/org/nongnu/libvob/view/FisheyeState.java     Thu Mar 27 06:04:52 2003
@@ -36,7 +36,7 @@
  * Uses clicks and drags by mouse button 3.
  */
 public class FisheyeState {
-public static final String rcsid = "$Id: FisheyeState.java,v 1.1 2003/03/27 
08:27:17 tjl Exp $";
+public static final String rcsid = "$Id: FisheyeState.java,v 1.2 2003/03/27 
11:04:52 tjl Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
@@ -104,7 +104,8 @@
        ((GLVobCoorder_Gen)vs.coords).setDistortParams(cs,
                    0, 0,
                    cursize * aspect, cursize,
-                   curmag, curmin);
+                   (float)Math.log(curmag), (float)Math.log(curmin)
+                   );
        vs.coords.setTranslateParams(cs2, -curx, -cury);
     }
 
Index: libvob/test/vob/gl/glvobcoorder.test
diff -u libvob/test/vob/gl/glvobcoorder.test:1.7 
libvob/test/vob/gl/glvobcoorder.test:1.8
--- libvob/test/vob/gl/glvobcoorder.test:1.7    Mon Mar 17 06:15:54 2003
+++ libvob/test/vob/gl/glvobcoorder.test        Thu Mar 27 06:04:53 2003
@@ -40,6 +40,8 @@
 vs2 = getvs()
 c2 = vs2.coords
 
+import math
+
 def testTransform():
 
     cs1 = c.ortho(0, 5, 10, 15, 0.5, 1)
@@ -48,7 +50,10 @@
     checkTrans(vs, cs, [0, 0, 0, 1, 1, 1, 2, 2, 2], [10, 15, 5, 11, 18, 9, 12, 
21, 13])
 
 
+    cs3 = c.distort(0, 0, 0, 0.1, 0.1, math.log(20), math.log(5))
+
 
+    checkTrans(vs, cs3, [0, 0, 0, 0.001, 0.001, 1], [0, 0, 0, 0.02, 0.02, 1], 
delta=0.00001, alsoRender = 0)
 
 
     t = c.translate(0, 100, 100)
@@ -232,12 +237,12 @@
 
 #test distorted outside (should not be drawn)
 #normally without distortion this should be drawn
-#    cs = c.affine(0, 0, 10, 10, 100, 0, 0, 100)
-#    cs_d = c.distort(cs, 0, 0, 1, 1, 1, 0.1) 
-#    cs_clip = c.affine(0, 0, 10, 100, 100, 0, 0, 100)
-#    cs_cull = c.cull(cs_d, cs_clip)
-#    putThings()
-#    checkAvgColor(10, 10, 80, 80, (255, 0, 0), delta=50)
+    cs = c.affine(0, 0, 10, 10, 100, 0, 0, 100)
+    cs_d = c.distort(cs, 0, 0, 1, 1, 1, 0.1) 
+    cs_clip = c.affine(0, 0, 10, 100, 100, 0, 0, 100)
+    cs_cull = c.cull(cs_d, cs_clip)
+    putThings()
+    checkAvgColor(10, 10, 80, 80, (255, 0, 0), delta=50)
 
 #test same area (should be drawn)
     cs = c.affine(0, 0, 10, 10, 100, 0, 0, 100)
@@ -264,13 +269,13 @@
     checkNotAvgColor(10, 10, 100, 100, (255, 0, 0), delta=50)
 
 ##test distorted inside (should be drawn)
-#    cs = c.affine(0, 0, 10, 10, 100, 0, 0, 100)
-#    cs_d = c.distort(cs, 0, 0, 1, 1, 1, 0.1) 
-#    cs_clip = c.affine(0, 0, 10, 90, 100, 0, 0, 100)
-#    cs_cull = c.cull(cs_d, cs_clip)
+    cs = c.affine(0, 0, 10, 10, 100, 0, 0, 100)
+    cs_d = c.distort(cs, 0, 0, 1, 1, 1, 0.1) 
+    cs_clip = c.affine(0, 0, 10, 90, 100, 0, 0, 100)
+    cs_cull = c.cull(cs_d, cs_clip)
 
-#    putThings()
-#    checkNotAvgColor(10, 10, 100, 100, (255, 0, 0), delta=50)
+    putThings()
+    checkNotAvgColor(10, 10, 100, 100, (255, 0, 0), delta=50)
 
 #test findBoundingBox bugfix (should be drawn)
     cs_box = c.orthoBox(0, 0, 0, 0, 200, 100, 1, 2)




reply via email to

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