Project

General

Profile

« Previous | Next » 

Revision 7589635e

Added by Leszek Koltunski almost 8 years ago

Major push towards simplifying DistortedObject's public API.
All MATRIX effects are using the new API - the 'DataND' marker interfaces.

View differences:

src/main/java/org/distorted/examples/fbo/FBORenderer.java
31 31
import org.distorted.library.Distorted;
32 32
import org.distorted.library.DistortedBitmap;
33 33
import org.distorted.library.EffectTypes;
34
import org.distorted.library.type.Float2D;
34
import org.distorted.library.type.Static2D;
35
import org.distorted.library.type.Static3D;
35 36

  
36 37
import android.graphics.Bitmap;
37 38
import android.graphics.BitmapFactory;
......
74 75
      if( lisaHeight/lisaWidth > height/width )
75 76
        {
76 77
        int w = (height*lisaWidth)/lisaHeight;
77
        mLisa.move((width-w)/2 ,0, 0);
78
        mLisa.scale((float)height/lisaHeight);
78
        float factor = (float)height/lisaHeight;
79

  
80
        mLisa.move( new Static3D((width-w)/2,0,0) );
81
        mLisa.scale( new Static3D(factor,factor,factor));
79 82
        }
80 83
      else
81 84
        {
82 85
        int h = (width*lisaHeight)/lisaWidth;
83
        mLisa.move(0 ,(height-h)/2, 0);
84
        mLisa.scale((float)width/lisaWidth);
86
        float factor = (float)width/lisaWidth;
87

  
88
        mLisa.move(  new Static3D(0,(height-h)/2,0) );
89
        mLisa.scale( new Static3D(factor,factor,factor) );
85 90
        }
86 91
      
87 92
      Distorted.onSurfaceChanged(width, height); 
......
122 127
     
123 128
      int textWidth  = mText.getWidth();
124 129
      int textHeight = mText.getHeight();
125
      
126
      mText.move(lisaWidth/6 , lisaHeight/3, 0);
127
      mText.scale(lisaWidth/(1.5f*textWidth));
128
      mText.sink(0.5f, new Float2D( textWidth/2, textHeight/2), 5000, 0.0f);
130

  
131
      float factor = lisaWidth/(1.5f*textWidth);
132

  
133
      mText.move( new Static3D(lisaWidth/6,lisaHeight/3,0) );
134
      mText.scale( new Static3D(factor,factor,factor) );
135
      mText.sink(0.5f, new Static2D( textWidth/2, textHeight/2), 5000, 0.0f);
129 136
      mLisa.macroblock(4, 10000, 0.0f);
130 137
      
131 138
      try

Also available in: Unified diff