Project

General

Profile

« Previous | Next » 

Revision 7126b262

Added by Leszek Koltunski over 5 years ago

Further improvement for the Generic app.

View differences:

src/main/java/org/distorted/examples/generic/GenericRenderer.java
141 141
      regionEffects.apply( centerMove );
142 142
      regionEffects.apply( new MatrixEffectMove(mRegionPoint) );
143 143
      regionEffects.apply( new MatrixEffectScale(mRegionScalePoint) );
144
      regionEffects.apply( new MatrixEffectMove(new Static3D( -regionSize/2 , -regionSize/2 , 0)) );
144
      regionEffects.apply( new MatrixEffectMove(new Static3D( -regionSize*0.5f , -regionSize*0.5f , 0)) );
145 145

  
146 146
      resetMatrixEffects();
147 147

  
......
257 257
        factorCen  = (0.08f  *width)/centerSize;
258 258
        }
259 259

  
260
      setCenter(0.5f,0.5f,0.0f);
261
      setRegion(0.0f,0.0f,0.0f,0.5f);
260
      setCenter(0.5f*mObjWidth,0.5f*mObjHeight,0.5f*mObjDepth);
261
      setRegion(0.0f,0.0f,0.0f,0.25f*(mObjWidth+mObjHeight));
262 262

  
263 263
      mMoveObject.set( (width-mFactorObj*mObjWidth)/2 , (height-mFactorObj*mObjHeight)/2 , -mFactorObj*mObjDepth );
264 264
      mRotateCen.set(width*0.5f,height*0.5f, 0);
src/main/java/org/distorted/examples/generic/GenericViewPager.java
34 34

  
35 35
class GenericViewPager
36 36
  {
37
  // Add here a new row to create another tab serving effects of a given type (you would also need to create
38
  // the three layouts to fill the first 3 values of the row )
39
  // Comment out a row to remove the tab.
40
  //
41 37
  static final int[] TABS =
42

  
43
      // LAYOUT ////////////  INNER LAYOUT ////////  SPINNER //////////////  EffectType /////////////////////  SHOW CENTER // SHOW REGION
44
    { R.layout.effects3dtab0, R.id.effects3dlayout0, R.id.effects3dspinner0, EffectType.MATRIX     .ordinal() ,             1,          0 ,
45
      R.layout.effects3dtab1, R.id.effects3dlayout1, R.id.effects3dspinner1, EffectType.VERTEX     .ordinal() ,             1,          1 ,
46
      R.layout.effects3dtab2, R.id.effects3dlayout2, R.id.effects3dspinner2, EffectType.FRAGMENT   .ordinal() ,             1,          0 ,
47
      R.layout.effects3dtab3, R.id.effects3dlayout3, R.id.effects3dspinner3, EffectType.POSTPROCESS.ordinal() ,             0,          0 };
38
    {
39
    // Add here a new row to create another tab serving effects of a given type (you would also need to
40
    // create a new layout to fill the first 3 values of the row ). Comment out a row to remove the tab.
41
    //
42
    // LAYOUT ////////////  INNER LAYOUT ////////  SPINNER //////////////  EFFECT_TYPE //////////////////// SHOW CENTER // SHOW REGION
43
    R.layout.effects3dtab0, R.id.effects3dlayout0, R.id.effects3dspinner0, EffectType.MATRIX     .ordinal() ,            1,          0 ,
44
    R.layout.effects3dtab1, R.id.effects3dlayout1, R.id.effects3dspinner1, EffectType.VERTEX     .ordinal() ,            1,          1 ,
45
    R.layout.effects3dtab2, R.id.effects3dlayout2, R.id.effects3dspinner2, EffectType.FRAGMENT   .ordinal() ,            1,          0 ,
46
    R.layout.effects3dtab3, R.id.effects3dlayout3, R.id.effects3dspinner3, EffectType.POSTPROCESS.ordinal() ,            0,          0
47
    };
48 48

  
49 49
  static final int NUM = 6;  // 6 ints required to describe 1 tab
50 50
  private static final int NUM_TABS = TABS.length/NUM;

Also available in: Unified diff