Project

General

Profile

« Previous | Next » 

Revision 39a0d81b

Added by Leszek Koltunski about 7 years ago

Convert next 4 APPs to the new Matrix effects.

View differences:

src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java
98 98
    
99 99
  public void onSurfaceChanged(GL10 glUnused, int width, int height) 
100 100
    {
101
    float qx = (float)width ;
102
    float qy = (float)height;
101
    float q= (float)width/height;
103 102
    float scale = 0.5f;
104 103

  
105 104
    mEffects.abortEffects(EffectTypes.MATRIX);
106 105
    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)) );
106
    mEffects.scale(  q<1 ? (new Static3D(scale,scale*q,scale)) : (new Static3D(scale/q,scale,scale/q)) );
108 107

  
109 108
    mScreen.resize(width, height);
110 109
    }

Also available in: Unified diff