Project

General

Profile

« Previous | Next » 

Revision b041d424

Added by Leszek Koltunski over 7 years ago

Minor details

View differences:

src/main/java/org/distorted/examples/wind/WindRenderer.java
55 55
      mView = view;
56 56

  
57 57
      mObject = new DistortedCubes(50,30,10,false);
58
      mEffects = new WindEffectsManager();
58
      mEffects = new WindEffectsManager(mObject);
59 59

  
60 60
      mObjWidth = mObject.getWidth();
61 61
      mObjHeight= mObject.getHeight();
......
83 83
    
84 84
   public void onSurfaceChanged(GL10 glUnused, int width, int height) 
85 85
      {
86
      mObject.abortEffects(EffectTypes.MATRIX);
87
      mObject.abortEffects(EffectTypes.VERTEX);
88
      mObject.abortEffects(EffectTypes.FRAGMENT);
86
      mObject.abortAllEffects();
89 87

  
90
      float factor = 0.8f*(width<height? width:height)/mObjWidth;
88
      float factor = ( (float)(width<height? width:height) )/(mObjHeight + 1.4f*mObjWidth);
91 89

  
92
      mObject.move( new Static3D( (width-factor*mObjWidth)/2 + width/8 , (height-factor*mObjHeight)/2 -height/4 , 0) );
90
      mObject.move( new Static3D( factor*mObjHeight*0.58f , factor*mObjHeight*0.08f , 0) );
93 91
      mObject.scale(factor);
94 92

  
95 93
      Static1D angle = new Static1D(-45);

Also available in: Unified diff