gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz gfx/libcoords/Coords.cxx gzz/vob/AffineVobC...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz gfx/libcoords/Coords.cxx gzz/vob/AffineVobC...
Date: Sun, 20 Oct 2002 05:50:06 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/10/20 05:50:06

Modified files:
        gfx/libcoords  : Coords.cxx 
        gzz/vob        : AffineVobCoorder.java 
        test/gzz/gfx/gl: glvobcoorder.test 

Log message:
        Fix rotation sense

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/AffineVobCoorder.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/glvobcoorder.test.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.40 gzz/gfx/libcoords/Coords.cxx:1.41
*** gzz/gfx/libcoords/Coords.cxx:1.40   Sun Oct 20 05:33:17 2002
--- gzz/gfx/libcoords/Coords.cxx        Sun Oct 20 05:50:06 2002
***************
*** 228,235 ****
         * coordsys.
         */
        void tr(const ZPt &from, ZPt &to) const {
!           to.x = c * from.x + s * from.y; 
!           to.y = -s * from.x + c * from.y; 
            to.z = from.z;
        }
        float tr_radius(const ZPt &from, float radius) const {
--- 228,235 ----
         * coordsys.
         */
        void tr(const ZPt &from, ZPt &to) const {
!           to.x = c * from.x + -s * from.y; 
!           to.y = s * from.x + c * from.y; 
            to.z = from.z;
        }
        float tr_radius(const ZPt &from, float radius) const {
Index: gzz/gzz/vob/AffineVobCoorder.java
diff -c gzz/gzz/vob/AffineVobCoorder.java:1.12 
gzz/gzz/vob/AffineVobCoorder.java:1.13
*** gzz/gzz/vob/AffineVobCoorder.java:1.12      Tue Oct 15 09:29:19 2002
--- gzz/gzz/vob/AffineVobCoorder.java   Sun Oct 20 05:50:06 2002
***************
*** 46,51 ****
--- 46,53 ----
            float x, float y, 
                float xx, float xy, float yx, float yy);
  
+     /** Get a subcs rotated clockwise.
+      */
      public abstract int rotate(int into, float degrees);
      public abstract int scale(int into, float sx, float sy, float sz);
  
Index: gzz/test/gzz/gfx/gl/glvobcoorder.test
diff -c gzz/test/gzz/gfx/gl/glvobcoorder.test:1.12 
gzz/test/gzz/gfx/gl/glvobcoorder.test:1.13
*** gzz/test/gzz/gfx/gl/glvobcoorder.test:1.12  Sun Oct 20 05:33:17 2002
--- gzz/test/gzz/gfx/gl/glvobcoorder.test       Sun Oct 20 05:50:06 2002
***************
*** 35,41 ****
                Vertex %s %s %s
                End
            """ % (src[i], src[i+1], src[i+2])
!           print "TEST: ",d
            vs.map.put(GLCache.getCallListCoorded(d), cs)
            render(vs)
            checkNotAvgColor(
--- 35,41 ----
                Vertex %s %s %s
                End
            """ % (src[i], src[i+1], src[i+2])
!           # print "TEST: ",d
            vs.map.put(GLCache.getCallListCoorded(d), cs)
            render(vs)
            checkNotAvgColor(
***************
*** 67,72 ****
--- 67,80 ----
      cs = c.concat(cs1, cs2)
      checkTrans(vs, cs, [0, 0, 0, 1, 1, 1, 2, 2, 2], [10, 15, 5, 11, 18, 9, 
12, 21, 13])
  
+     t = c.translate(0, 100, 100)
+     r = c.rotate(t, 0)
+     checkTrans(vs, r, [0, 0, 0, 0, 50, 0], [100, 100, 0, 100, 150, 0])
+     # Clockwise rotation
+     c.setRotateParams(r, 90)
+     checkTrans(vs, r, [0, 0, 0, 0, 50, 0], [100, 100, 0, 50, 100, 0])
+ 
+ 
  def checkInverse(c, cs):
      # unit cube
      src = array([
***************
*** 156,175 ****
  
  def testNadir():
  
!     cs_nadir = c1.translate(0, 500, 1000)  
!     cs_center = c1.translate(0, 500, 0)
      cs_rot = c1.nadirOrigin(cs_center, cs_nadir)
  
      checkTrans(vs1, cs_rot,
        [0, 0, 0,   0, 10, 0],
!       [500, 0, 0, 500, 10, 0],
        .1)
  
!     c1.setTranslateParams(cs_center, 0, 1000)
  
      checkTrans(vs1, cs_rot,
        [0, 0, 0,   0, 10, 0],
!       [0, 1000, 0, 10, 1000, 0],
        .1)
  
  
--- 164,183 ----
  
  def testNadir():
  
!     cs_nadir = c1.translate(0, 50, 100)  
!     cs_center = c1.translate(0, 50, 0)
      cs_rot = c1.nadirOrigin(cs_center, cs_nadir)
  
      checkTrans(vs1, cs_rot,
        [0, 0, 0,   0, 10, 0],
!       [50, 0, 0, 50, 10, 0],
        .1)
  
!     c1.setTranslateParams(cs_center, 20, 100)
  
      checkTrans(vs1, cs_rot,
        [0, 0, 0,   0, 10, 0],
!       [20, 100, 0, 30, 100, 0],
        .1)
  
  




reply via email to

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