Project

General

Profile

« Previous | Next » 

Revision 630703d1

Added by Leszek Koltunski about 7 years ago

Revert "Major refactoring: convert the Matrix Effects to be independent of the resolution of the surface we render to."

This reverts commit d79a56d3bc6cc7a22b21abeb180353a1818bd6ad.

View differences:

src/main/java/org/distorted/examples/deform/DeformRenderer.java
100 100
      fpsTexture.setTexture(fpsBitmap);
101 101
      fpsCanvas = new Canvas(fpsBitmap);
102 102
      fpsEffects = new DistortedEffects();
103
      fpsEffects.move( new Static3D(5,5,0) );
103 104

  
104 105
      mPaint = new Paint();
105 106
      mPaint.setAntiAlias(true);
......
107 108
      mPaint.setTextSize(0.7f*fpsH);
108 109

  
109 110
      stretchEffects = new DistortedEffects();
110
      stretchEffects.scale(0.5f);
111 111

  
112 112
      mRegion = new Static4D(0,0,0,0);
113 113

  
......
205 205
     scrHeight = height;
206 206
     scrWidth  = width;
207 207

  
208
     fpsEffects.abortAllEffects();
209
     fpsEffects.move(  new Static3D( -0.5f + (fpsW/2 + 5.0f)/width, -0.5f + (fpsH/2 + 5.0f)/height,0.0f) );
210
     fpsEffects.scale( new Static3D( (float)fpsW/width, (float)fpsH/height, 1.0f) );
211

  
212 208
     mRegion.set3(mRadius*scrWidth);
213 209

  
214 210
     Canvas stretchCanvas;
......
235 231
     if( stretchTexture==null ) stretchTexture = new DistortedTexture(w,h);
236 232
     stretchTexture.setTexture(stretchBitmap);
237 233

  
234
     stretchEffects.abortAllEffects();
235
     stretchEffects.move( new Static3D(scrWidth/4,scrHeight/4,0) );
236

  
238 237
     mScreen.detachAll();
239 238
     mScreen.attach(stretchTexture,stretchEffects,stretchMesh);
240 239
     mScreen.attach(fpsTexture,fpsEffects,fpsMesh);
......
270 269
     if( xt>scrWidth/2 ) xt=scrWidth/2;
271 270
     if( yt<0 ) yt=0;
272 271
     if( yt>scrHeight/2 ) yt=scrHeight/2;
272
      
273
     touchPoint.set(xt,yt,0);
273 274

  
274 275
     switch(mMode)
275 276
       {
276 277
       case DISTORT: vDistort[0].set(0,0,0);
277
                     touchPoint.set(xt,yt,0);
278 278
                     mLastEffect = stretchEffects.distort( mMovingDistortDynamic, touchPoint, mRegion);
279 279
                     break;
280 280
       case DEFORM : vDeform[0].set(0,0,0);
281
                     touchPoint.set(xt,yt,0);
282 281
                     mLastEffect = stretchEffects.deform( mMovingDeformDynamic, touchPoint, mRegion);
283 282
                     break;
284 283
       case SHEAR  : vShear[0].set(0,0,0);
285
                     touchPoint.set( (float)xt/scrWidth, (float)yt/scrHeight,0);
286 284
                     mLastEffect = stretchEffects.shear(mMovingShearDynamic, touchPoint);
287 285
                     break;
288 286
       }

Also available in: Unified diff