Project

General

Profile

« Previous | Next » 

Revision fce25d04

Added by Leszek Koltunski about 7 years ago

Revert "Progress with the last 2 Apps: Effects3D and Wind (not done yet)"

This reverts commit 752c6b57bb227292e6c28438b955fcb892f7acc6.

View differences:

src/main/java/org/distorted/examples/wind/WindRenderer.java
21 21

  
22 22
import android.graphics.Bitmap;
23 23
import android.graphics.BitmapFactory;
24
import android.opengl.GLES30;
24 25
import android.opengl.GLSurfaceView;
25 26

  
26 27
import org.distorted.examples.R;
......
84 85
      }
85 86

  
86 87
///////////////////////////////////////////////////////////////////////////////////////////////////
87

  
88
    
88 89
   public void onSurfaceChanged(GL10 glUnused, int width, int height) 
89 90
      {
90
      float q= ((float)width/height)*((float)mObjHeight/mObjWidth);
91
      float scale = 0.5f;
91
      mEffects.abortAllEffects();
92

  
93
      float factor = ( (float)(width<height? width:height) )/(mObjHeight + 1.4f*mObjWidth);
94

  
95
      mEffects.move( new Static3D( factor*mObjHeight*0.58f , factor*mObjHeight*0.08f , 0) );
96
      mEffects.scale(factor);
97

  
92 98
      Static1D angle = new Static1D(-45);
93 99
      Static3D axis  = new Static3D(0,0,1);
94
      Static3D center= new Static3D( -scale/2,0,0 );
95
      Static3D move  = new Static3D( 0,((float)width/height)*(1-scale/2)-0.5f,0 );
96

  
97
      mEffects.abortAllEffects();
98
      //mEffects.move( move );
99
      //mEffects.rotate(angle, axis, center);
100
      //mManager.apply(mEffects,mWind);
101
      mEffects.scale(q<1 ? (new Static3D(scale,scale*q,scale)) : (new Static3D(scale/q,scale,scale/q)));
100
      Static3D center= new Static3D(0,mObjHeight/2,0);
102 101

  
102
      mEffects.rotate(angle, axis, center);
103
      mManager.apply(mEffects,mWind);
103 104
      mScreen.resize(width, height);
104 105
      }
105 106

  

Also available in: Unified diff