Project

General

Profile

« Previous | Next » 

Revision 7bf107f7

Added by Leszek Koltunski almost 8 years ago

Some more progress with porting apps to new VERTEX API.

View differences:

src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
29 29
import org.distorted.library.Distorted;
30 30
import org.distorted.library.DistortedBitmap;
31 31
import org.distorted.library.EffectTypes;
32
import org.distorted.library.type.Dynamic3D;
32 33
import org.distorted.library.type.Static2D;
33 34
import org.distorted.library.type.Static3D;
34 35
import org.distorted.library.type.Static4D;
......
46 47
    private DistortedBitmap monaLisa;
47 48
    private Static2D pLeft, pRight;
48 49
    private Static4D rLeft, rRight;
49
    private Static3D vLeft, vRight;
50
    private Dynamic3D dLeft, dRight;
51

  
50 52
    private int bmpHeight, bmpWidth;
51 53
    
52 54
///////////////////////////////////////////////////////////////////////////////////////////////////
......
60 62
      
61 63
      rLeft = new Static4D(-10,-10,25,25);
62 64
      rRight= new Static4D( 10, -5,25,25);
63
      
64
      vLeft = new Static3D(-20,-20,0);
65
      vRight= new Static3D( 20,-10,0);
65

  
66
      dLeft = new Dynamic3D();
67
      dRight= new Dynamic3D();
68

  
69
      dLeft.setDuration(1000);
70
      dRight.setDuration(1000);
71

  
72
      dLeft.setCount(0);
73
      dRight.setCount(0);
74

  
75
      dLeft.add( new Static3D(  0,  0,0) );
76
      dLeft.add( new Static3D(-20,-20,0) );
77

  
78
      dRight.add( new Static3D(  0,  0,0) );
79
      dRight.add( new Static3D( 20,-10,0) );
66 80
      }
67 81

  
68 82
///////////////////////////////////////////////////////////////////////////////////////////////////
......
125 139
      bmpWidth  = bitmap.getWidth();
126 140
      
127 141
      monaLisa = new DistortedBitmap(bitmap, 10);
128
      monaLisa.distort( vLeft, rLeft , pLeft, 1000, 0);
129
      monaLisa.distort(vRight, rRight, pRight,1000, 0);
130
      
142
      monaLisa.distort( dLeft, pLeft , rLeft );
143
      monaLisa.distort(dRight, pRight, rRight);
144

  
131 145
      try
132 146
        {
133 147
        Distorted.onSurfaceCreated(mView.getContext());

Also available in: Unified diff