Project

General

Profile

« Previous | Next » 

Revision 10b7e588

Added by Leszek Koltunski about 8 years ago

Rename various classes; fix a bug in Around the World.

View differences:

src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java
26 26

  
27 27
import org.distorted.examples.R;
28 28
import org.distorted.library.Distorted;
29
import org.distorted.library.DistortedBitmapGrid;
29
import org.distorted.library.GridFlat;
30 30
import org.distorted.library.DistortedObject;
31 31
import org.distorted.library.EffectTypes;
32 32
import org.distorted.library.type.Static3D;
......
43 43
{
44 44
   private GLSurfaceView mView;
45 45
   private DistortedObject mObject;
46
   private DistortedBitmapGrid mGrid;
46
   private GridFlat mGrid;
47 47
   private AroundTheWorldEffectsManager mEffects;
48 48
   private int mObjWidth, mObjHeight;
49 49

  
......
119 119
        catch(IOException e) { }
120 120
        }
121 121

  
122

  
123
      mObjWidth = mObject.getWidth();
124
      mObjHeight= mObject.getHeight();
122
      mObjWidth = bitmap.getWidth();
123
      mObjHeight= bitmap.getHeight();
125 124

  
126 125
      mObject = new DistortedObject(mObjWidth,mObjHeight,1);
127 126
      mObject.setTexture(bitmap);
128 127
      mEffects.apply(mObject);
129 128

  
130
      mGrid = new DistortedBitmapGrid(30,30*mObjHeight/mObjWidth);
129
      mGrid = new GridFlat(30,30*mObjHeight/mObjWidth);
131 130

  
132 131
      try
133 132
        {
src/main/java/org/distorted/examples/bean/BeanRenderer.java
30 30
import org.distorted.library.EffectTypes;
31 31
import org.distorted.library.Distorted;
32 32
import org.distorted.library.DistortedObject;
33
import org.distorted.library.DistortedBitmapGrid;
33
import org.distorted.library.GridFlat;
34 34
import org.distorted.library.type.Dynamic3D;
35 35
import org.distorted.library.type.Static3D;
36 36
import org.distorted.library.type.Static4D;
......
46 46
{
47 47
   private GLSurfaceView mView;
48 48
   private DistortedObject mBean;
49
   private DistortedBitmapGrid mGrid;
49
   private GridFlat mGrid;
50 50
   private Static3D pLeft, pRight;
51 51
   private Dynamic3D dLeft, dRight;
52 52
   private Static4D rLeft, rRight;
......
149 149
      mBean.distort(dLeft , pLeft , rLeft );
150 150
      mBean.distort(dRight, pRight, rRight);
151 151

  
152
      mGrid = new DistortedBitmapGrid(25,25*bmpHeight/bmpWidth);
152
      mGrid = new GridFlat(25,25*bmpHeight/bmpWidth);
153 153

  
154 154
      try
155 155
        {
src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java
28 28
import org.distorted.examples.R;
29 29
import org.distorted.library.Distorted;
30 30
import org.distorted.library.DistortedObject;
31
import org.distorted.library.DistortedBitmapGrid;
31
import org.distorted.library.GridFlat;
32 32
import org.distorted.library.EffectTypes;
33 33
import org.distorted.library.type.Dynamic1D;
34 34
import org.distorted.library.type.Dynamic3D;
......
47 47
{
48 48
    private GLSurfaceView mView;
49 49
    private DistortedObject mObject;
50
    private DistortedBitmapGrid mGrid;
50
    private GridFlat mGrid;
51 51
    private Static4D chromaRegion, alphaRegion;
52 52
    private int bmpHeight, bmpWidth;
53 53

  
......
94 94
      bmpHeight = bitmap.getHeight();
95 95
      bmpWidth  = bitmap.getWidth();
96 96

  
97
      mGrid = new DistortedBitmapGrid(1,1);  // no vertex effects, grid can be a (1x1) quad.
97
      mGrid = new GridFlat(1,1);  // no vertex effects, grid can be a (1x1) quad.
98 98

  
99 99
      mObject = new DistortedObject(bmpWidth,bmpHeight,1);
100 100
      mObject.setTexture(bitmap);
src/main/java/org/distorted/examples/check/CheckRenderer.java
29 29

  
30 30
import org.distorted.library.Distorted;
31 31
import org.distorted.library.DistortedObject;
32
import org.distorted.library.DistortedBitmapGrid;
32
import org.distorted.library.GridFlat;
33 33
import org.distorted.library.EffectTypes;
34 34
import org.distorted.library.type.Dynamic3D;
35 35
import org.distorted.library.type.Static1D;
......
55 55

  
56 56
    private GLSurfaceView mView;
57 57
    private DistortedObject mSuccess;
58
    private DistortedBitmapGrid mGrid;
58
    private GridFlat mGrid;
59 59
    private int bmpHeight, bmpWidth;
60 60

  
61 61
///////////////////////////////////////////////////////////////////////////////////////////////////
......
131 131

  
132 132
      mSuccess = new DistortedObject(bmpWidth,bmpHeight,1);
133 133
      mSuccess.setTexture(bitmap);
134
      mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
134
      mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
135 135

  
136 136
      // Try adding 2 Vertex Effects to the Bitmap.
137 137
      // This will fail if we have set maxVertexEffects to something < 2.
src/main/java/org/distorted/examples/cubes/CubesActivity.java
22 22
import org.distorted.library.Distorted;
23 23
import org.distorted.examples.R;
24 24
import org.distorted.library.DistortedObject;
25
import org.distorted.library.DistortedObjectGrid;
26
import org.distorted.library.DistortedCubesGrid;
25
import org.distorted.library.GridObject;
26
import org.distorted.library.GridCubes;
27 27

  
28 28
import android.app.Activity;
29 29
import android.opengl.GLSurfaceView;
......
49 49
    private LinearLayout mLay;
50 50
    private boolean[] mShape;
51 51
    private DistortedObject mObject;
52
    private DistortedObjectGrid mGrid;
52
    private GridObject mGrid;
53 53

  
54 54
///////////////////////////////////////////////////////////////////////////////////////////////////
55 55
    
......
199 199
      for(int i=0; i<mNumRows*mNumCols; i++)
200 200
        str += mShape[i] ? "1" : "0";
201 201

  
202
      mGrid = new DistortedCubesGrid(mNumCols, str, false);
202
      mGrid = new GridCubes(mNumCols, str, false);
203 203
      mObject = new DistortedObject(mNumCols,mNumRows,1);
204 204

  
205 205
      setContentView(R.layout.cubeslayout);
......
214 214

  
215 215
///////////////////////////////////////////////////////////////////////////////////////////////////
216 216

  
217
    public DistortedObjectGrid getGrid()
217
    public GridObject getGrid()
218 218
      {
219 219
      return mGrid;
220 220
      }
src/main/java/org/distorted/examples/cubes/CubesRenderer.java
28 28
import org.distorted.examples.R;
29 29

  
30 30
import org.distorted.library.DistortedObject;
31
import org.distorted.library.DistortedObjectGrid;
31
import org.distorted.library.GridObject;
32 32
import org.distorted.library.EffectTypes;
33 33
import org.distorted.library.type.DynamicQuat;
34 34
import org.distorted.library.type.Static4D;
......
46 46
{
47 47
    private GLSurfaceView mView;
48 48
    private DistortedObject mObject;
49
    private DistortedObjectGrid mGrid;
49
    private GridObject mGrid;
50 50
    private int mObjWidth, mObjHeight;
51 51

  
52 52
    private DynamicQuat mQuatInt1, mQuatInt2;
src/main/java/org/distorted/examples/deform/DeformRenderer.java
24 24

  
25 25
import org.distorted.library.Distorted;
26 26
import org.distorted.library.DistortedObject;
27
import org.distorted.library.DistortedObjectGrid;
28
import org.distorted.library.DistortedBitmapGrid;
27
import org.distorted.library.GridObject;
28
import org.distorted.library.GridFlat;
29 29

  
30 30
import org.distorted.library.EffectNames;
31 31
import org.distorted.library.EffectTypes;
......
50 50

  
51 51
   private GLSurfaceView mView;
52 52
   private DistortedObject fps, stretch;
53
   private DistortedObjectGrid fpsGrid, stretchGrid;
53
   private GridObject fpsGrid, stretchGrid;
54 54
   private Static3D touchPoint;
55 55

  
56 56
   private Dynamic3D mReleasedDistortDynamic;
......
235 235
      
236 236
      mPaint = new Paint();
237 237
      stretch = new DistortedObject(w,h,1);
238
      stretchGrid = new DistortedBitmapGrid(50,50*h/w);
238
      stretchGrid = new GridFlat(50,50*h/w);
239 239
      Bitmap stretchBitmap = Bitmap.createBitmap(w,h, Bitmap.Config.ARGB_8888);
240 240
      stretchCanvas = new Canvas(stretchBitmap);
241 241
      
......
259 259
      touchPoint= new Static3D(0,0,0);
260 260
        
261 261
      fps = new DistortedObject( fpsW, fpsH, 1);
262
      fpsGrid = new DistortedBitmapGrid(1,1);
262
      fpsGrid = new GridFlat(1,1);
263 263

  
264 264
      fpsBitmap = Bitmap.createBitmap(fpsW,fpsH, Bitmap.Config.ARGB_8888);
265 265
      fpsCanvas = new Canvas(fpsBitmap);
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java
29 29

  
30 30
import org.distorted.library.Distorted;
31 31
import org.distorted.library.DistortedObject;
32
import org.distorted.library.DistortedBitmapGrid;
32
import org.distorted.library.GridFlat;
33 33
import org.distorted.library.EffectTypes;
34 34
import org.distorted.library.type.Dynamic3D;
35 35
import org.distorted.library.type.Static1D;
......
49 49
   
50 50
   private GLSurfaceView mView;
51 51
   private DistortedObject[] mObj;
52
   private DistortedBitmapGrid mGrid;
52
   private GridFlat mGrid;
53 53
   private Static3D mPoint;
54 54
   private Dynamic3D dDistort;
55 55
   private int bmpHeight, bmpWidth;
......
163 163
      mObj[0].sink( new Static1D(8), mPoint, new Static4D(0,0,80,80));
164 164
      mObj[0].distort(dDistort,mPoint);
165 165

  
166
      mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
166
      mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
167 167

  
168 168
      try
169 169
        {
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java
28 28
import org.distorted.examples.R;
29 29

  
30 30
import org.distorted.library.Distorted;
31
import org.distorted.library.DistortedBitmapGrid;
31
import org.distorted.library.GridFlat;
32 32
import org.distorted.library.DistortedObject;
33 33
import org.distorted.library.EffectTypes;
34 34
import org.distorted.library.type.Dynamic1D;
......
50 50
   
51 51
   private GLSurfaceView mView;
52 52
   private DistortedObject[] mObj;
53
   private DistortedBitmapGrid mGrid;
53
   private GridFlat mGrid;
54 54
   private Static3D pLeft, pRight, pNose1;
55 55
   private Static4D RegionEye;
56 56
   private Dynamic3D mDI;
......
148 148
     bmpHeight = bitmap.getHeight();
149 149
     bmpWidth  = bitmap.getWidth();
150 150

  
151
     mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
151
     mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
152 152

  
153 153
     mObj = new DistortedObject[NUM];
154 154
     mObj[0] = new DistortedObject(bmpWidth, bmpHeight, 1);
src/main/java/org/distorted/examples/dynamic/DynamicRenderer.java
29 29
import android.opengl.GLES20;
30 30
import android.opengl.GLSurfaceView;
31 31

  
32
import org.distorted.library.DistortedBitmapGrid;
32
import org.distorted.library.GridFlat;
33 33
import org.distorted.library.DistortedObject;
34 34
import org.distorted.library.Distorted;
35 35

  
......
39 39
   {  
40 40
   private DynamicSurfaceView mView;
41 41
   private DistortedObject mBackground;
42
   private DistortedBitmapGrid mGrid;
42
   private GridFlat mGrid;
43 43
   private Canvas mCanvas;
44 44
   private Bitmap mBitmap;
45 45
   private Paint mPaint;
......
80 80
     texW = width;
81 81
     texH = height;
82 82

  
83
     mGrid       = new DistortedBitmapGrid(1,1);
83
     mGrid       = new GridFlat(1,1);
84 84
     mBackground = new DistortedObject(texW,texH,1);
85 85
     mBitmap     = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888);
86 86
     mCanvas     = new Canvas(mBitmap);
src/main/java/org/distorted/examples/effectqueue/EffectQueueRenderer.java
29 29
import android.opengl.GLES20;
30 30
import android.opengl.GLSurfaceView;
31 31

  
32
import org.distorted.library.DistortedBitmapGrid;
32
import org.distorted.library.GridFlat;
33 33
import org.distorted.library.DistortedObject;
34 34
import org.distorted.library.Distorted;
35 35
import org.distorted.library.EffectNames;
......
51 51
  private int texWidth, texHeight;
52 52

  
53 53
  DistortedObject mBackground;
54
  DistortedBitmapGrid mGrid;
54
  GridFlat mGrid;
55 55

  
56 56
///////////////////////////////////////////////////////////////////////////////////////////////////
57 57

  
......
67 67
    texWidth = BWID;
68 68
    texHeight= BHEI;
69 69

  
70
    mGrid      = new DistortedBitmapGrid(80,80*texHeight/texWidth);
70
    mGrid      = new GridFlat(80,80*texHeight/texWidth);
71 71
    mBackground= new DistortedObject(texWidth,texHeight,1);
72 72

  
73 73
    mBackground.addEventListener(this);
src/main/java/org/distorted/examples/effects3d/Effects3DActivity.java
38 38

  
39 39
import org.distorted.examples.R;
40 40
import org.distorted.library.Distorted;
41
import org.distorted.library.DistortedBitmapGrid;
42
import org.distorted.library.DistortedCubesGrid;
43
import org.distorted.library.DistortedObjectGrid;
41
import org.distorted.library.GridFlat;
42
import org.distorted.library.GridCubes;
43
import org.distorted.library.GridObject;
44 44
import org.distorted.library.DistortedObject;
45 45
import org.distorted.library.EffectNames;
46 46
import org.distorted.library.EffectTypes;
......
67 67
  private NumberPicker mColsPicker, mRowsPicker;
68 68
  private boolean[] mShape;
69 69
  private DistortedObject mObject;
70
  private DistortedObjectGrid mGrid;
70
  private GridObject mGrid;
71 71
  private int mObjectType;
72 72
  private int mBitmapID;
73 73
  private Bitmap mBitmap;
......
224 224

  
225 225
///////////////////////////////////////////////////////////////////////////////////////////////////
226 226

  
227
  public DistortedObjectGrid getGrid()
227
  public GridObject getGrid()
228 228
    {
229 229
    return mGrid;
230 230
    }
......
402 402
      int h = mBitmap.getHeight();
403 403

  
404 404
      mObject = new DistortedObject(w,h,1);
405
      mGrid   = new DistortedBitmapGrid(mNumCols,mNumCols*h/w);
405
      mGrid   = new GridFlat(mNumCols,mNumCols*h/w);
406 406
      setEffectView();
407 407
      }
408 408
    else
......
432 432
      str += mShape[i] ? "1" : "0";
433 433

  
434 434
    mObject = new DistortedObject(mNumCols,mNumRows,1);
435
    mGrid   = new DistortedCubesGrid(mNumCols, str, false);
435
    mGrid   = new GridCubes(mNumCols, str, false);
436 436

  
437 437
    setEffectView();
438 438
    }
src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java
26 26

  
27 27
import org.distorted.examples.R;
28 28
import org.distorted.library.Distorted;
29
import org.distorted.library.DistortedBitmapGrid;
29
import org.distorted.library.GridFlat;
30 30
import org.distorted.library.DistortedObject;
31
import org.distorted.library.DistortedObjectGrid;
31
import org.distorted.library.GridObject;
32 32
import org.distorted.library.EffectTypes;
33 33
import org.distorted.library.type.Dynamic3D;
34 34
import org.distorted.library.type.DynamicQuat;
......
50 50
    private DistortedObject mBackground;
51 51
    private DistortedObject mCenter;
52 52
    private DistortedObject mRegion;
53
    private DistortedBitmapGrid mQuad;
54
    private DistortedObjectGrid mGrid;
53
    private GridFlat mQuad;
54
    private GridObject mGrid;
55 55
    private int mObjWidth, mObjHeight, mObjDepth;
56 56
    private DynamicQuat mQuatInt1, mQuatInt2;
57 57

  
......
78 78
      mBackground = new DistortedObject(100, 100, 1);
79 79
      mCenter     = new DistortedObject(100, 100, 1);
80 80
      mRegion     = new DistortedObject(100, 100, 1);
81
      mQuad       = new DistortedBitmapGrid(1,1);
81
      mQuad       = new GridFlat(1,1);
82 82

  
83 83
      mObjWidth = mObject.getWidth();
84 84
      mObjHeight= mObject.getHeight();
src/main/java/org/distorted/examples/fbo/FBORenderer.java
27 27

  
28 28
import org.distorted.examples.R;
29 29

  
30
import org.distorted.library.DistortedNode;
30
import org.distorted.library.DistortedObjectTree;
31 31
import org.distorted.library.Distorted;
32
import org.distorted.library.DistortedBitmapGrid;
32
import org.distorted.library.GridFlat;
33 33
import org.distorted.library.DistortedObject;
34 34
import org.distorted.library.EffectTypes;
35 35
import org.distorted.library.type.Dynamic1D;
......
49 49
   private DistortedObject mLisa;
50 50
   private int lisaHeight, lisaWidth;
51 51
    
52
   private DistortedNode mRoot;
52
   private DistortedObjectTree mRoot;
53 53
    
54 54
///////////////////////////////////////////////////////////////////////////////////////////////////
55 55

  
......
126 126
      DistortedObject text = new DistortedObject(bitmap2.getWidth(),bitmap2.getHeight(),1);
127 127
      text.setTexture(bitmap2);
128 128

  
129
      mRoot = new DistortedNode(mLisa,new DistortedBitmapGrid(1,1));
130
      mRoot.attach(text,new DistortedBitmapGrid(20,5));
129
      mRoot = new DistortedObjectTree(mLisa,new GridFlat(1,1));
130
      mRoot.attach(text,new GridFlat(20,5));
131 131
     
132 132
      int textWidth  = text.getWidth();
133 133
      int textHeight = text.getHeight();
src/main/java/org/distorted/examples/flag/FlagRenderer.java
26 26

  
27 27
import org.distorted.examples.R;
28 28
import org.distorted.library.Distorted;
29
import org.distorted.library.DistortedCubesGrid;
29
import org.distorted.library.GridCubes;
30 30
import org.distorted.library.DistortedObject;
31 31
import org.distorted.library.EffectTypes;
32 32
import org.distorted.library.type.Dynamic;
......
48 48
{
49 49
    private GLSurfaceView mView;
50 50
    private DistortedObject mObject;
51
    private DistortedCubesGrid mGrid;
51
    private GridCubes mGrid;
52 52
    private int mObjWidth, mObjHeight;
53 53
    private DynamicQuat mQuatInt1, mQuatInt2;
54 54
    private Dynamic5D mWaveDyn;
......
63 63
      {
64 64
      mView = v;
65 65

  
66
      mGrid = new DistortedCubesGrid(50,30,false);
66
      mGrid = new GridCubes(50,30,false);
67 67
      mObject = new DistortedObject(500,300,10);
68 68

  
69 69
      mObjWidth = mObject.getWidth();
src/main/java/org/distorted/examples/girl/GirlRenderer.java
28 28
import org.distorted.examples.R;
29 29

  
30 30
import org.distorted.library.Distorted;
31
import org.distorted.library.DistortedBitmapGrid;
31
import org.distorted.library.GridFlat;
32 32
import org.distorted.library.DistortedObject;
33 33
import org.distorted.library.EffectTypes;
34 34
import org.distorted.library.type.Dynamic1D;
......
48 48
{
49 49
    private GLSurfaceView mView;
50 50
    private DistortedObject mGirl;
51
    private DistortedBitmapGrid mGrid;
51
    private GridFlat mGrid;
52 52
    private Static3D pLeft, pRight, pHips;
53 53
    private Static4D Region, sinkRegion, HipsRegion;
54 54
    private Dynamic3D diL, diR;
......
207 207
      bmpHeight = bitmap.getHeight();
208 208
      bmpWidth  = bitmap.getWidth();
209 209

  
210
      mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
210
      mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
211 211
      mGirl = new DistortedObject(bmpWidth,bmpHeight,1);
212 212
      mGirl.setTexture(bitmap);
213 213

  
src/main/java/org/distorted/examples/listener/ListenerRenderer.java
29 29
import org.distorted.examples.R;
30 30

  
31 31
import org.distorted.library.Distorted;
32
import org.distorted.library.DistortedBitmapGrid;
32
import org.distorted.library.GridFlat;
33 33
import org.distorted.library.DistortedObject;
34 34
import org.distorted.library.EffectNames;
35 35
import org.distorted.library.EffectTypes;
......
52 52

  
53 53
   private GLSurfaceView mView;
54 54
   private DistortedObject mWater;
55
   private DistortedBitmapGrid mGrid;
55
   private GridFlat mGrid;
56 56
   private int bmpHeight, bmpWidth;
57 57
   private Random mRnd;
58 58

  
......
154 154
      bmpHeight = bitmap.getHeight();
155 155
      bmpWidth  = bitmap.getWidth();
156 156

  
157
      mGrid  = new DistortedBitmapGrid(50,50*bmpHeight/bmpWidth);
157
      mGrid  = new GridFlat(50,50*bmpHeight/bmpWidth);
158 158
      mWater = new DistortedObject(bmpWidth,bmpHeight,1);
159 159
      mWater.setTexture(bitmap);
160 160
      mWater.addEventListener(this);
src/main/java/org/distorted/examples/matrix3d/Matrix3DActivity.java
32 32

  
33 33
import org.distorted.examples.R;
34 34
import org.distorted.library.Distorted;
35
import org.distorted.library.DistortedObjectGrid;
36
import org.distorted.library.DistortedCubesGrid;
35
import org.distorted.library.GridObject;
36
import org.distorted.library.GridCubes;
37 37
import org.distorted.library.DistortedObject;
38 38
import org.distorted.library.EffectNames;
39 39
import org.distorted.library.EffectTypes;
......
47 47
public class Matrix3DActivity extends Activity implements AdapterView.OnItemSelectedListener
48 48
  {
49 49
  private DistortedObject mObject;
50
  private DistortedObjectGrid mGrid;
50
  private GridObject mGrid;
51 51

  
52 52
  private ArrayList<Matrix3DEffect> mEffects;
53 53
  private int mEffectAdd;
......
67 67

  
68 68
    createEffectNames();
69 69

  
70
    mGrid   = new DistortedCubesGrid(1,1,false);
70
    mGrid   = new GridCubes(1,1,false);
71 71
    mObject = new DistortedObject(100,100,100);
72 72

  
73 73
    setEffectView();
......
106 106

  
107 107
///////////////////////////////////////////////////////////////////////////////////////////////////
108 108

  
109
  public DistortedObjectGrid getGrid()
109
  public GridObject getGrid()
110 110
    {
111 111
    return mGrid;
112 112
    }
src/main/java/org/distorted/examples/matrix3d/Matrix3DRenderer.java
23 23
import android.opengl.GLSurfaceView;
24 24

  
25 25
import org.distorted.library.Distorted;
26
import org.distorted.library.DistortedObjectGrid;
26
import org.distorted.library.GridObject;
27 27
import org.distorted.library.DistortedObject;
28 28
import org.distorted.library.EffectTypes;
29 29

  
......
36 36
{
37 37
    private GLSurfaceView mView;
38 38
    private DistortedObject mObject;
39
    private DistortedObjectGrid mGrid;
39
    private GridObject mGrid;
40 40

  
41 41
    private int mWidth, mHeight;
42 42

  
src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
28 28
import org.distorted.examples.R;
29 29
import org.distorted.library.Distorted;
30 30
import org.distorted.library.DistortedObject;
31
import org.distorted.library.DistortedBitmapGrid;
31
import org.distorted.library.GridFlat;
32 32
import org.distorted.library.EffectTypes;
33 33
import org.distorted.library.type.Dynamic3D;
34 34
import org.distorted.library.type.Static3D;
......
45 45
{
46 46
    private GLSurfaceView mView;
47 47
    private DistortedObject mObject;
48
    private DistortedBitmapGrid mGrid;
48
    private GridFlat mGrid;
49 49
    private Static3D pLeft, pRight;
50 50
    private Static4D rLeft, rRight;
51 51
    private Dynamic3D dLeft, dRight;
......
128 128
      bmpHeight = bitmap.getHeight();
129 129
      bmpWidth  = bitmap.getWidth();
130 130

  
131
      mGrid = new DistortedBitmapGrid(9,9*bmpHeight/bmpWidth);
131
      mGrid = new GridFlat(9,9*bmpHeight/bmpWidth);
132 132
      mObject = new DistortedObject(bmpWidth,bmpHeight,1);
133 133
      mObject.setTexture(bitmap);
134 134
      mObject.distort( dLeft, pLeft , rLeft );
src/main/java/org/distorted/examples/movingeffects/MovingEffectsRenderer.java
30 30
import android.opengl.GLSurfaceView;
31 31

  
32 32
import org.distorted.library.DistortedObject;
33
import org.distorted.library.DistortedBitmapGrid;
33
import org.distorted.library.GridFlat;
34 34
import org.distorted.library.Distorted;
35 35

  
36 36
///////////////////////////////////////////////////////////////////////////////////////////////////
......
43 43
   private Paint mPaint;
44 44
   private int texW, texH;
45 45

  
46
   private DistortedBitmapGrid mGrid;
46
   private GridFlat mGrid;
47 47

  
48 48
   static DistortedObject mBackground;
49 49

  
......
105 105
     texW = width;
106 106
     texH = height;
107 107

  
108
     mGrid = new DistortedBitmapGrid(80,80*height/width);
108
     mGrid = new GridFlat(80,80*height/width);
109 109
     mBackground = new DistortedObject(texW,texH,1);
110 110
     mBitmap = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888);
111 111
     mCanvas = new Canvas(mBitmap);
src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java
27 27

  
28 28
import org.distorted.examples.R;
29 29

  
30
import org.distorted.library.DistortedObjectTree;
30 31
import org.distorted.library.EffectTypes;
31 32
import org.distorted.library.type.Dynamic1D;
32
import org.distorted.library.DistortedNode;
33 33
import org.distorted.library.type.Static3D;
34 34
import org.distorted.library.type.Static1D;
35 35
import org.distorted.library.Distorted;
36
import org.distorted.library.DistortedBitmapGrid;
36
import org.distorted.library.GridFlat;
37 37
import org.distorted.library.DistortedObject;
38 38

  
39 39
import android.graphics.Bitmap;
......
50 50
   private static final int NUM_LEAVES  = 8;
51 51
   
52 52
   private GLSurfaceView mView;
53
   private DistortedNode mScreen;
53
   private DistortedObjectTree mScreen;
54 54
   private DistortedObject mLeaf;
55 55

  
56 56
///////////////////////////////////////////////////////////////////////////////////////////////////
......
60 60
      mView = v;
61 61

  
62 62
      mLeaf = new DistortedObject(LEAF_SIZE,LEAF_SIZE,1);
63
      DistortedBitmapGrid grid = new DistortedBitmapGrid(1,1);
63
      GridFlat grid = new GridFlat(1,1);
64 64

  
65
      mScreen = new DistortedNode(new DistortedObject(9*LEAF_SIZE,9*LEAF_SIZE,1), grid);
65
      mScreen = new DistortedObjectTree(new DistortedObject(9*LEAF_SIZE,9*LEAF_SIZE,1), grid);
66 66
     
67 67
      Dynamic1D rot = new Dynamic1D(5000,0.0f);
68 68
      rot.setMode(Dynamic1D.MODE_JUMP);
69 69
      rot.add(new Static1D(  0));
70 70
      rot.add(new Static1D(360));
71 71
      
72
      DistortedNode[] mCircleNode = new DistortedNode[NUM_CIRCLES];
72
      DistortedObjectTree[] mCircleNode = new DistortedObjectTree[NUM_CIRCLES];
73 73
    
74 74
      int[] colors    = new int[] {0,0,1,  0,0,0,  1,0,0,  1,1,0,  0,1,0}; // blue, black, red, yellow, green  
75 75
      int[] positions = new int[] {0*LEAF_SIZE,2*LEAF_SIZE,  3*LEAF_SIZE,2*LEAF_SIZE,  6*LEAF_SIZE,2*LEAF_SIZE,  3*LEAF_SIZE/2,9*LEAF_SIZE/2,  9*LEAF_SIZE/2,9*LEAF_SIZE/2};
......
83 83
        {
84 84
        if( i==0 )
85 85
          {
86
          mCircleNode[i] = new DistortedNode(new DistortedObject(3*LEAF_SIZE,3*LEAF_SIZE,1), grid);
86
          mCircleNode[i] = new DistortedObjectTree(new DistortedObject(3*LEAF_SIZE,3*LEAF_SIZE,1), grid);
87 87
        
88 88
          for(int j=0; j<NUM_LEAVES; j++)
89 89
            {
......
95 95
          }
96 96
        else
97 97
          {
98
          mCircleNode[i] = new DistortedNode(mCircleNode[0], Distorted.CLONE_BITMAP|Distorted.CLONE_CHILDREN); 
98
          mCircleNode[i] = new DistortedObjectTree(mCircleNode[0], Distorted.CLONE_BITMAP|Distorted.CLONE_CHILDREN);
99 99
          }
100 100
      
101 101
        mScreen.attach(mCircleNode[i]);
src/main/java/org/distorted/examples/plainmonalisa/RenderThread.java
31 31
import android.view.SurfaceView;
32 32

  
33 33
import org.distorted.library.Distorted;
34
import org.distorted.library.DistortedBitmapGrid;
34
import org.distorted.library.GridFlat;
35 35
import org.distorted.library.DistortedObject;
36 36
import org.distorted.library.EffectTypes;
37 37
import org.distorted.library.type.Dynamic3D;
......
61 61
  private EGLSurface eglSurface;
62 62

  
63 63
  private DistortedObject monaLisa;
64
  private DistortedBitmapGrid mGrid;
64
  private GridFlat mGrid;
65 65
  private int bmpHeight, bmpWidth;
66 66

  
67 67
  private Static3D pLeft, pRight;
......
198 198
    monaLisa.distort(dRight, pRight, rRight);
199 199
    monaLisa.setTexture(bmp);
200 200

  
201
    mGrid= new DistortedBitmapGrid(9,9*bmpHeight/bmpWidth);  // more-or-less square Grid with 9 columns.
201
    mGrid= new GridFlat(9,9*bmpHeight/bmpWidth);  // more-or-less square Grid with 9 columns.
202 202

  
203 203
    try
204 204
      {
src/main/java/org/distorted/examples/projection/ProjectionRenderer.java
23 23
import javax.microedition.khronos.opengles.GL10;
24 24

  
25 25
import org.distorted.library.Distorted;
26
import org.distorted.library.DistortedBitmapGrid;
26
import org.distorted.library.GridFlat;
27 27
import org.distorted.library.DistortedObject;
28 28
import org.distorted.library.type.Static3D;
29 29
import org.distorted.library.type.Static4D;
......
41 41
{
42 42
   private GLSurfaceView mView;
43 43
   private DistortedObject mProjection;
44
   private DistortedBitmapGrid mGrid;
44
   private GridFlat mGrid;
45 45

  
46 46
   private static float mF, mX, mY;
47 47
   private static int mWidth, mHeight;
......
121 121
      {
122 122
      Paint paint = new Paint();
123 123
      mProjection = new DistortedObject(w,h,1);
124
      mGrid       = new DistortedBitmapGrid(50,50*h/w);
124
      mGrid       = new GridFlat(50,50*h/w);
125 125
      Bitmap bmp = Bitmap.createBitmap(w,h, Bitmap.Config.ARGB_8888);
126 126
      Canvas bmpCanvas = new Canvas(bmp);
127 127

  
src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java
31 31
import org.distorted.library.EffectTypes;
32 32
import org.distorted.library.type.Dynamic;
33 33
import org.distorted.library.type.DynamicQuat;
34
import org.distorted.library.DistortedCubesGrid;
34
import org.distorted.library.GridCubes;
35 35
import org.distorted.library.DistortedObject;
36 36
import org.distorted.library.type.Static4D;
37 37
import org.distorted.library.type.Static3D;
......
50 50

  
51 51
  private GLSurfaceView mView;
52 52
  private DistortedObject mCube;
53
  private DistortedCubesGrid mGrid;
53
  private GridCubes mGrid;
54 54

  
55 55
  private DynamicQuat mRot;
56 56
    
......
59 59
  QuaternionRenderer(GLSurfaceView v)
60 60
    {
61 61
    mView = v;
62
    mGrid = new DistortedCubesGrid(1,1,false);
62
    mGrid = new GridCubes(1,1,false);
63 63
    mCube = new DistortedObject(1,1,1);
64 64

  
65 65
    mRot = new DynamicQuat();
src/main/java/org/distorted/examples/save/SaveRenderer.java
32 32

  
33 33
import org.distorted.library.Distorted;
34 34
import org.distorted.library.DistortedObject;
35
import org.distorted.library.DistortedBitmapGrid;
35
import org.distorted.library.GridFlat;
36 36
import org.distorted.library.DistortedFramebuffer;
37 37
import org.distorted.library.EffectTypes;
38 38
import org.distorted.library.type.Dynamic1D;
......
53 53
  {
54 54
  private GLSurfaceView mView;
55 55
  private DistortedObject mGirl;
56
  private DistortedBitmapGrid mGrid;
56
  private GridFlat mGrid;
57 57
  private DistortedFramebuffer mOffscreen;
58 58
  private Static3D pLeft, pRight;
59 59
  private Static4D sinkRegion;
......
228 228
    bmpHeight = bitmap.getHeight();
229 229
    bmpWidth  = bitmap.getWidth();
230 230

  
231
    mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
231
    mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
232 232
    mGirl = new DistortedObject(bmpWidth,bmpHeight,1);
233 233
    mGirl.setTexture(bitmap);
234 234

  
src/main/java/org/distorted/examples/sink/SinkRenderer.java
28 28
import org.distorted.examples.R;
29 29

  
30 30
import org.distorted.library.Distorted;
31
import org.distorted.library.DistortedBitmapGrid;
31
import org.distorted.library.GridFlat;
32 32
import org.distorted.library.DistortedObject;
33 33
import org.distorted.library.EffectTypes;
34 34
import org.distorted.library.type.Dynamic1D;
......
47 47
  {
48 48
  private GLSurfaceView mView;
49 49
  private DistortedObject mObject;
50
  private DistortedBitmapGrid mGrid;
50
  private GridFlat mGrid;
51 51
  private Static3D pLeft, pRight;
52 52
  private Static4D Region;
53 53
  private int bmpHeight, bmpWidth;
......
126 126
    dSink.add(new Static1D( 1));
127 127
    dSink.add(new Static1D(10));
128 128

  
129
    mGrid = new DistortedBitmapGrid(30,30*bmpHeight/bmpWidth);
129
    mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
130 130
    mObject = new DistortedObject(bmpWidth,bmpHeight,1);
131 131
    mObject.setTexture(bitmap);
132 132
    
src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java
28 28

  
29 29
import org.distorted.examples.R;
30 30

  
31
import org.distorted.library.DistortedBitmapGrid;
31
import org.distorted.library.GridFlat;
32 32
import org.distorted.library.EffectNames;
33 33
import org.distorted.library.type.Dynamic1D;
34 34
import org.distorted.library.type.Dynamic3D;
35
import org.distorted.library.DistortedNode;
35
import org.distorted.library.DistortedObjectTree;
36 36
import org.distorted.library.type.Static1D;
37 37
import org.distorted.library.type.Static3D;
38 38
import org.distorted.library.type.Static4D;
......
106 106
  private long gffaID, logoID, crawlID;
107 107
    
108 108
  private Random mRnd = new Random(0);
109
  private DistortedNode mRoot, mBackground;
110
  private DistortedBitmapGrid mQuad;
109
  private DistortedObjectTree mRoot, mBackground;
110
  private GridFlat mQuad;
111 111

  
112 112

  
113 113
///////////////////////////////////////////////////////////////////////////////////////////////////
......
116 116
    {
117 117
    mView = v;
118 118

  
119
    mQuad = new DistortedBitmapGrid(1,1);
119
    mQuad = new GridFlat(1,1);
120 120
    Distorted.setProjection(60.0f, 0.0f, 0.0f);
121 121
    }
122 122

  
......
159 159
  private void setupScreen(int w, int h)
160 160
    {
161 161
    mScreen = new DistortedObject(w,h,1);
162
    mRoot = new DistortedNode(mScreen,mQuad);
162
    mRoot = new DistortedObjectTree(mScreen,mQuad);
163 163
      
164 164
    mCrawlBackground = new DistortedObject(w,(int)(Math.sqrt(3.0)*h),1);
165 165
       
src/main/java/org/distorted/examples/wind/WindRenderer.java
26 26

  
27 27
import org.distorted.examples.R;
28 28
import org.distorted.library.Distorted;
29
import org.distorted.library.DistortedCubesGrid;
29
import org.distorted.library.GridCubes;
30 30
import org.distorted.library.DistortedObject;
31 31
import org.distorted.library.type.Static1D;
32 32
import org.distorted.library.type.Static3D;
......
43 43
{
44 44
   private GLSurfaceView mView;
45 45
   private DistortedObject mObject;
46
   private DistortedCubesGrid mGrid;
46
   private GridCubes mGrid;
47 47
   private WindEffectsManager mEffects;
48 48
   private int mObjWidth, mObjHeight;
49 49
   private int mWind;
......
54 54
      { 
55 55
      mView = view;
56 56

  
57
      mGrid    = new DistortedCubesGrid(50,30,false);
57
      mGrid    = new GridCubes(50,30,false);
58 58
      mObject  = new DistortedObject(50,30,1);
59 59
      mEffects = new WindEffectsManager(mObject);
60 60

  

Also available in: Unified diff