Project

General

Profile

« Previous | Next » 

Revision 0fb42347

Added by Leszek Koltunski about 7 years ago

Revert "Convert a few more APPs to the new resolution-independent Matrix Effects."

This reverts commit 19938eb7e76e004b164589f0ca6eec2894935e08.

View differences:

src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java
41 41

  
42 42
import android.graphics.Bitmap;
43 43
import android.graphics.BitmapFactory;
44
import android.opengl.GLES30;
44 45
import android.opengl.GLSurfaceView;
45 46

  
46 47
///////////////////////////////////////////////////////////////////////////////////////////////////
......
98 99
    
99 100
  public void onSurfaceChanged(GL10 glUnused, int width, int height) 
100 101
    {
101
    float qx = (float)width ;
102
    float qy = (float)height;
103
    float scale = 0.5f;
102
    float scaleFactor = width>height ? height/3:width/3;
104 103

  
105 104
    mEffects.abortEffects(EffectTypes.MATRIX);
106
    mEffects.quaternion( mRot, new Static3D(0,0,0) );
107
    mEffects.scale(  qx<qy ? (new Static3D(scale,scale*qx/qy,scale)) : (new Static3D(scale*qy/qx,scale,scale)) );
108

  
105
    mEffects.move( new Static3D( (width-scaleFactor)/2 , (height-scaleFactor)/2 , 0) );
106
    mEffects.scale(scaleFactor);
107
    mEffects.quaternion( mRot, new Static3D( (float)mTexture.getWidth()/2, (float)mTexture.getHeight()/2 , 0) );
108
       
109 109
    mScreen.resize(width, height);
110 110
    }
111 111

  

Also available in: Unified diff