Project

General

Profile

« Previous | Next » 

Revision 26c4e181

Added by Leszek Koltunski about 4 years ago

First fixes for moving the Vertex and Fragment centers of effect to the center of the Mesh.

View differences:

src/main/java/org/distorted/examples/bean/BeanRenderer.java
51 51
   private DistortedScreen mScreen;
52 52
   private DistortedTexture mTexture;
53 53
   private MeshRectangles mMesh;
54
   private Static3D mScale;
54
   private Static3D mScale, mBrowL, mBrowR;
55 55

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

  
......
59 59
      {
60 60
      mView = v;
61 61
     
62
      Static3D pointLeft  = new Static3D( 98, 297, 0);
63
      Static3D pointRight = new Static3D(233, 340, 0);
62

  
64 63
      Static4D regionLeft = new Static4D( -3, 33, 0, 47);
65 64
      Static4D regionRight= new Static4D(-14, 33, 0, 47);
66 65
      Dynamic3D dynLeft   = new Dynamic3D(2000,0.0f);
......
84 83
      dynRight.add(vect1);
85 84

  
86 85
      mScale= new Static3D(1,1,1);
86
      mBrowL= new Static3D(0,0,0);
87
      mBrowR= new Static3D(0,0,0);
87 88

  
88 89
      mEffects = new DistortedEffects();
89
      mEffects.apply( new VertexEffectDistort(dynLeft , pointLeft , regionLeft) );
90
      mEffects.apply( new VertexEffectDistort(dynRight, pointRight, regionRight));
90
      mEffects.apply( new VertexEffectDistort(dynLeft , mBrowL, regionLeft) );
91
      mEffects.apply( new VertexEffectDistort(dynRight, mBrowR, regionRight));
91 92
      mEffects.apply( new MatrixEffectScale(mScale) );
92 93

  
93 94
      mScreen = new DistortedScreen();
......
135 136
     int bmpHeight = bitmap.getHeight();
136 137
     int bmpWidth  = bitmap.getWidth();
137 138

  
139
     mBrowL.set( 98 - bmpWidth/2, 297 - bmpHeight/2, 0);
140
     mBrowR.set(233 - bmpWidth/2, 340 - bmpHeight/2, 0);
141

  
138 142
     if( mTexture==null ) mTexture = new DistortedTexture();
139 143
     mTexture.setTexture(bitmap);
144

  
140 145
     if( mMesh==null )
141 146
       {
142 147
       mMesh = new MeshRectangles(25,25*bmpHeight/bmpWidth);

Also available in: Unified diff