Project

General

Profile

« Previous | Next » 

Revision b5cc7760

Added by Leszek Koltunski almost 8 years ago

New API fully ported; not tested yet but stuff compiles.

View differences:

src/main/java/org/distorted/examples/bean/BeanRenderer.java
31 31
import org.distorted.library.type.Dynamic2D;
32 32
import org.distorted.library.Distorted;
33 33
import org.distorted.library.DistortedBitmap;
34
import org.distorted.library.type.Dynamic3D;
34 35
import org.distorted.library.type.Static2D;
35 36
import org.distorted.library.type.Static3D;
36 37
import org.distorted.library.type.Static4D;
......
47 48
   private GLSurfaceView mView;
48 49
   private DistortedBitmap mBean;
49 50
   private Static2D pLeft, pRight;
50
   private Dynamic2D iLeft, iRight;
51
   private Dynamic3D dLeft, dRight;
51 52
   private Static4D rLeft, rRight;
52 53
   private int bmpHeight, bmpWidth;
53 54
    
......
63 64
      rLeft = new Static4D(-9,-31,35,35);
64 65
      rRight= new Static4D(-9,-31,35,35);
65 66
     
66
      iLeft = new Dynamic2D();
67
      iRight= new Dynamic2D();
67
      dLeft = new Dynamic3D();
68
      dRight= new Dynamic3D();
68 69
     
69
      iLeft.setCount(0.0f);
70
      iRight.setCount(0.0f);
71
      iLeft.setDuration(1500);
72
      iRight.setDuration(1500);
70
      dLeft.setCount(0.0f);
71
      dRight.setCount(0.0f);
72
      dLeft.setDuration(1500);
73
      dRight.setDuration(1500);
73 74
      
74
      Static2D p1 = new Static2D(0,0);
75
      Static2D p2 = new Static2D(-10,-34);
75
      Static3D p1 = new Static3D(  0,  0, 0);
76
      Static3D p2 = new Static3D(-10,-34, 0);
76 77
      
77
      iLeft.add(p1);
78
      iLeft.add(p1);
79
      iLeft.add(p1);
80
      iLeft.add(p1);
81
      iLeft.add(p2);
82
      iLeft.add(p2);
78
      dLeft.add(p1);
79
      dLeft.add(p1);
80
      dLeft.add(p1);
81
      dLeft.add(p1);
82
      dLeft.add(p2);
83
      dLeft.add(p2);
83 84
      
84
      iRight.add(p1);
85
      iRight.add(p2);
86
      iRight.add(p2);
87
      iRight.add(p1);
88
      iRight.add(p1);
89
      iRight.add(p1);
85
      dRight.add(p1);
86
      dRight.add(p2);
87
      dRight.add(p2);
88
      dRight.add(p1);
89
      dRight.add(p1);
90
      dRight.add(p1);
90 91
      }
91 92

  
92 93
///////////////////////////////////////////////////////////////////////////////////////////////////
......
149 150
      bmpWidth  = bitmap.getWidth();
150 151
      
151 152
      mBean = new DistortedBitmap(bitmap, 10);     
152
      mBean.distort(iLeft , rLeft , pLeft );
153
      mBean.distort(iRight, rRight, pRight);
153
      mBean.distort(dLeft , pLeft , rLeft );
154
      mBean.distort(dRight, pRight, rRight);
154 155
      
155 156
      try
156 157
        {

Also available in: Unified diff