Project

General

Profile

« Previous | Next » 

Revision 687263cc

Added by Leszek Koltunski about 4 years ago

Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)

View differences:

src/main/java/org/distorted/examples/listener/ListenerRenderer.java
66 66
   ListenerRenderer(GLSurfaceView v)
67 67
      {
68 68
      mView = v;
69
      mEffects = new DistortedEffects();
69

  
70 70
      mScreen = new DistortedScreen();
71 71
      mRnd = new Random(0);
72 72

  
73 73
      mMove = new Static3D(0,0,0);
74 74
      mScale= new Static3D(1,1,1);
75
      mEffects.apply(new MatrixEffectScale(mScale));
76
      mEffects.apply(new MatrixEffectMove(mMove));
77 75
      }
78 76

  
79 77
///////////////////////////////////////////////////////////////////////////////////////////////////
......
162 160
     bmpHeight = bitmap.getHeight();
163 161
     bmpWidth  = bitmap.getWidth();
164 162

  
165
     if( mTexture==null ) mTexture = new DistortedTexture(bmpWidth,bmpHeight);
163
     if( mTexture==null ) mTexture = new DistortedTexture();
166 164
     mTexture.setTexture(bitmap);
167 165

  
168 166
     if( mMesh==null ) mMesh = new MeshRectangles(50,50*bmpHeight/bmpWidth);
169 167

  
168
     if( mEffects==null )
169
       {
170
       mEffects = new DistortedEffects(bmpWidth,bmpHeight,0);
171
       mEffects.apply(new MatrixEffectScale(mScale));
172
       mEffects.apply(new MatrixEffectMove(mMove));
173
       }
174

  
170 175
     mScreen.detachAll();
171 176
     mScreen.attach(mTexture,mEffects,mMesh);
172 177

  

Also available in: Unified diff