gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz doc/pegboard/1011/PEG_1011.rst gfx/libcoord...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz doc/pegboard/1011/PEG_1011.rst gfx/libcoord...
Date: Thu, 10 Oct 2002 05:29:52 -0400

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

Modified files:
        doc/pegboard/1011: PEG_1011.rst 
        gfx/libcoords  : Coords.cxx 
        gzz/gfx/gl     : GLVobCoorder.java 
        gzz/modules/pp : demotest.py 
        gzz/view       : VobVanishingClient.java 

Log message:
        Nadir coordsys; start fixing coordsys

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/1011/PEG_1011.rst.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVobCoorder.java.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/VobVanishingClient.java.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gzz/doc/pegboard/1011/PEG_1011.rst
diff -c gzz/doc/pegboard/1011/PEG_1011.rst:1.1 
gzz/doc/pegboard/1011/PEG_1011.rst:1.2
*** gzz/doc/pegboard/1011/PEG_1011.rst:1.1      Tue Oct  8 02:46:52 2002
--- gzz/doc/pegboard/1011/PEG_1011.rst  Thu Oct 10 05:29:51 2002
***************
*** 3,11 ****
  =============================================================
  
  :Authors:  Tuomas Lukka
! :Date:     $Date: 2002/10/08 06:46:52 $
! :Revision: $Revision: 1.1 $
! :Status:   Incomplete
  
  With the transformPoints3 function of PEG 1009, most of Vob.RenderInfo
  is not necessary any more.
--- 3,11 ----
  =============================================================
  
  :Authors:  Tuomas Lukka
! :Date:     $Date: 2002/10/10 09:29:51 $
! :Revision: $Revision: 1.2 $
! :Status:   Current [ needed to fix AWT client's coordsys stuff ]
  
  With the transformPoints3 function of PEG 1009, most of Vob.RenderInfo
  is not necessary any more.
***************
*** 29,31 ****
--- 29,36 ----
  
  Also, all render() methods should only get one RenderInfo object, as
  it will mostly be about colors.
+ 
+ The render() method's new prototype would be
+ 
+       public void render(Graphics g, VobCoorder coords,
+                   int cs1, int cs2, Vob.RenderInfo ri);
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.37 gzz/gfx/libcoords/Coords.cxx:1.38
*** gzz/gfx/libcoords/Coords.cxx:1.37   Thu Oct 10 01:10:21 2002
--- gzz/gfx/libcoords/Coords.cxx        Thu Oct 10 05:29:51 2002
***************
*** 241,246 ****
--- 241,272 ----
        }
      };
  
+     /** Rotate the downwards vector at the origin
+      * towards the given point.
+      * XXX Document somewhere why!
+      * XXX Think: to make more flexible, need separate parent,
+      * nadirorigin, nadirpoint, rotatearoundpoint.
+      * I.e. the point where the downwards vector needs to face
+      * the nadir might not be the center of rotation.
+      * This gets quite hairy then.
+      */
+     class NadirOriginCoords {
+     public:
+       typedef RotateXYCoords BaseTransform;
+       enum { NParams = 0 };
+       void derivedParams(CoordSys *super, CoordSys *nadirCS,
+                           float *params, float *newparams) {
+           ZPt origin = super->transform(ZPt(0,0,0));
+           ZPt nadir = nadirCS->transform(ZPt(0,0,0));
+ 
+           float x = origin.x - nadir.x;
+           float y = origin.y - nadir.y;
+           float angle = atan2(x, -y);
+ 
+           newparams[0] = angle * 180 / M_PI;
+       }
+     };
+ 
      /** Translation.
       * Parameter layout: x, y, z
       */
***************
*** 638,643 ****
--- 664,670 ----
        new TransFactory<TranslateXYZCoords>(), // 6
        new DerTransFactory<BuoyOnCircleCoords>(), // 7
        new NoTransFactory<ConcatCoordSys>(), // 8
+       new DerTransFactory<NadirOriginCoords>(), // 9
        0
      };
  
Index: gzz/gzz/gfx/gl/GLVobCoorder.java
diff -c gzz/gzz/gfx/gl/GLVobCoorder.java:1.40 
gzz/gzz/gfx/gl/GLVobCoorder.java:1.41
*** gzz/gzz/gfx/gl/GLVobCoorder.java:1.40       Wed Oct  9 10:38:41 2002
--- gzz/gzz/gfx/gl/GLVobCoorder.java    Thu Oct 10 05:29:51 2002
***************
*** 29,35 ****
  import gzz.client.gl.*;
  
  public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.40 2002/10/09 
14:38:41 tjl Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
--- 29,35 ----
  import gzz.client.gl.*;
  
  public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.41 2002/10/10 
09:29:51 tjl Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 146,151 ****
--- 146,166 ----
  
        return was;
      }
+ 
+     public int nadirOrigin(int into, int nadir) {
+       int paramInd = nfloats;
+       nfloats += 0;
+ 
+       inds[ninds + 0] = 9; // nadir
+       inds[ninds + 1] = into;
+       inds[ninds + 2] = nadir;
+       inds[ninds + 3] = paramInd;
+       int was = ninds;
+       ninds += 4;
+ 
+       return was;
+     }
+ 
  
  
  
Index: gzz/gzz/modules/pp/demotest.py
diff -c gzz/gzz/modules/pp/demotest.py:1.8 gzz/gzz/modules/pp/demotest.py:1.9
*** gzz/gzz/modules/pp/demotest.py:1.8  Wed Oct  9 10:38:41 2002
--- gzz/gzz/modules/pp/demotest.py      Thu Oct 10 05:29:51 2002
***************
*** 92,105 ****
            self.poffset = self.offset
            self.but = ev.getModifiers()
        elif ev.getID() == ev.MOUSE_DRAGGED:
!           if self.but == MouseEvent.BUTTON3_MASK:
                self.scale = self.pscale * math.exp(
                        (self.press[1] - ev.getY())/150.0)
                self.sap()
                replaceNewScene(self.currentvs)
                AbstractUpdateManager.setNoAnimation()
                AbstractUpdateManager.chg()
!           elif self.but == MouseEvent.BUTTON1_MASK:
                self.offset = (
                 self.poffset[0] - (ev.getX() - self.press[0]),
                 self.poffset[1] - (ev.getY() - self.press[1]),
--- 92,105 ----
            self.poffset = self.offset
            self.but = ev.getModifiers()
        elif ev.getID() == ev.MOUSE_DRAGGED:
!           if self.but == ev.BUTTON3_MASK:
                self.scale = self.pscale * math.exp(
                        (self.press[1] - ev.getY())/150.0)
                self.sap()
                replaceNewScene(self.currentvs)
                AbstractUpdateManager.setNoAnimation()
                AbstractUpdateManager.chg()
!           elif self.but == ev.BUTTON1_MASK:
                self.offset = (
                 self.poffset[0] - (ev.getX() - self.press[0]),
                 self.poffset[1] - (ev.getY() - self.press[1]),
Index: gzz/gzz/view/VobVanishingClient.java
diff -c gzz/gzz/view/VobVanishingClient.java:1.13 
gzz/gzz/view/VobVanishingClient.java:1.14
*** gzz/gzz/view/VobVanishingClient.java:1.13   Tue Oct  1 09:06:10 2002
--- gzz/gzz/view/VobVanishingClient.java        Thu Oct 10 05:29:51 2002
***************
*** 73,80 ****
  
      public VobVanishingClient() {
          for(int i=0; i<2; i++)
!             for(int j=0; j<2; j++)
!                 connections[i][j] = new SimpleConnection(i,j,-i,-j);
  
          pstubs[0] = new TDecor(false, 1);
          pstubs[1] = new TDecor(true, 1);
--- 73,83 ----
  
      public VobVanishingClient() {
          for(int i=0; i<2; i++)
!             for(int j=0; j<2; j++) {
!               float xloc = 0.5f + i/2.0f;
!               float yloc = 0.5f + j/2.0f;
!                 connections[i][j] = new 
SimpleConnection(xloc,yloc,1-xloc,1-yloc);
!       }
  
          pstubs[0] = new TDecor(false, 1);
          pstubs[1] = new TDecor(true, 1);




reply via email to

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