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/wind/WindRenderer.java
61 61
      { 
62 62
      mView = view;
63 63

  
64
      mTexture = new DistortedTexture(50,30);
65
      mManager = new WindEffectsManager(mTexture);
64
      MeshCubes cubes = new MeshCubes(50,30,1);
65
      DistortedEffects effects = new DistortedEffects(50,30,1);
66

  
67
      mTexture = new DistortedTexture();
68
      mManager = new WindEffectsManager(50,30);
66 69
      mGust    = new WindGust();
67 70
      mScreen  = new DistortedScreen();
68 71

  
69
      DistortedEffects effects = new DistortedEffects();
70

  
71
      mScreen.attach(mTexture,effects,new MeshCubes(50,30,1));
72
      mScreen.attach(mTexture,effects,cubes);
72 73

  
73
      mObjWidth = mTexture.getWidth();
74
      mObjHeight= mTexture.getHeight();
74
      mObjWidth = effects.getStartchX();
75
      mObjHeight= effects.getStartchY();
75 76

  
76 77
      mManager.apply(effects);
77 78

  
......
113 114
      int min = width<height? width:height;
114 115

  
115 116
      float factor = ((float)min)/(mObjHeight + 1.4f*mObjWidth);
116
      mMove.set( factor*mObjHeight*0.58f +(width-min)/2, height - factor*mObjHeight*1.08f -(height-min)/2, 0 );
117
      mMove.set( factor*mObjHeight*0.58f +(width-min)*0.5f, height - factor*mObjHeight*1.08f -(height-min)*0.5f, 0 );
117 118
      mScale.set(factor,factor,factor);
118 119
      mScreen.resize(width, height);
119 120
      }

Also available in: Unified diff