Project

General

Profile

« Previous | Next » 

Revision dae661e9

Added by Leszek Koltunski about 5 years ago

Invert the order of Matrix Effects. Now, just as in the other queues, the first matrix effect is actually the first to act on the object - not the other way around!

View differences:

src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java
223 223
      randomAlpha1 = 0.2f + 0.8f*mRnd.nextFloat();
224 224
      randomAlpha2 = 0.8f + 0.2f*mRnd.nextFloat();
225 225
      randomTime = 500+mRnd.nextInt(2000);
226
      
227
      mStarEffects[i].apply( new MatrixEffectMove(new Static3D(randomX,randomY,0)) );
228
      mStarEffects[i].apply( new MatrixEffectScale(randomS) );
226

  
229 227
      mStarEffects[i].apply( new MatrixEffectRotate(new Static1D(randomA), axis, center) );
230
      
228
      mStarEffects[i].apply( new MatrixEffectScale(randomS) );
229
      mStarEffects[i].apply( new MatrixEffectMove(new Static3D(randomX,randomY,0)) );
230

  
231 231
      Dynamic1D di = new Dynamic1D(randomTime,0.0f);
232 232
      di.setNoise(alphaNoise);
233 233
      di.add(new Static1D(randomAlpha1));
......
249 249
    alpha.notifyWhenFinished(this);
250 250
    alphaEffectID = alpha.getID();
251 251

  
252
    mGFFAEffects.apply( new MatrixEffectMove(new Static3D(w/5,2*h/3,0)) );
253 252
    mGFFAEffects.apply( new MatrixEffectScale(scale) );
253
    mGFFAEffects.apply( new MatrixEffectMove(new Static3D(w/5,2*h/3,0)) );
254 254
    mGFFAEffects.apply( alpha );
255 255
      
256 256
    mScreen.attach(mGFFATexture, mGFFAEffects, mQuad);
......
392 392
      scale.notifyWhenFinished(this);
393 393
      scaleEffectID = scale.getID();
394 394

  
395
      mLogoEffects.apply( new MatrixEffectMove(new Static3D(screenW/2,screenH/2,0)) );
396
      mLogoEffects.apply( scale );
397 395
      mLogoEffects.apply( new MatrixEffectMove(new Static3D(-logoW/2,-logoH/2,0)) );
398
      
396
      mLogoEffects.apply( scale );
397
      mLogoEffects.apply( new MatrixEffectMove(new Static3D(screenW/2,screenH/2,0)) );
398

  
399 399
      mScreen.attach(mLogoTexture, mLogoEffects,mQuad);
400 400
      }
401 401
    else if( effectID == scaleEffectID )
......
423 423
      move.notifyWhenFinished(this);
424 424
      moveEffectID = move.getID();
425 425

  
426
      mCrawlEffects.apply( move );
427
      mCrawlEffects.apply( new MatrixEffectScale(new Static3D(scale,scale,scale)) );
428 426
      mCrawlEffects.apply( new MatrixEffectMove(new Static3D(-crawlW/2,-crawlH/2,0)) );
429
        
427
      mCrawlEffects.apply( new MatrixEffectScale(new Static3D(scale,scale,scale)) );
428
      mCrawlEffects.apply( move );
429

  
430 430
      mBackground = mScreen.attach(mCrawlBackgroundTexture, mCrawlBackgroundEffects,mQuad);
431 431
      mBackground.attach(mCrawlTexture, mCrawlEffects,mQuad);
432 432
      mBackground.glDisable(GLES31.GL_DEPTH_TEST);

Also available in: Unified diff