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/postprocesstree/PostprocessTreeRenderer.java
89 89

  
90 90
      DistortedNode root = new DistortedNode(new DistortedTexture(mScreenW,mScreenH), rootEffects, mesh);
91 91

  
92
      rootEffects.apply(new MatrixEffectMove(mMove));
93 92
      rootEffects.apply(new MatrixEffectScale(mScale));
93
      rootEffects.apply(new MatrixEffectMove(mMove));
94 94
      rootEffects.apply(blurEffect);
95 95

  
96 96
      Dynamic1D rotate = new Dynamic1D(5000,0.0f);
......
108 108
      for(int j=0; j<NUM_LEAVES; j++)
109 109
        {
110 110
        outerLeafEffects[j] = new DistortedEffects();
111
        outerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, outerCenter) );
112 111
        outerLeafEffects[j].apply(new MatrixEffectMove(outerMoveVector));
112
        outerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, outerCenter) );
113 113

  
114 114
        root.attach(mLeaf, outerLeafEffects[j], mesh);
115 115
        }
116 116

  
117
      innerEffects.apply( new MatrixEffectMove(new Static3D( (OUTER-INNER)*LEAF_SIZE/2,(OUTER-INNER)*LEAF_SIZE/2, 0)) );
118 117
      innerEffects.apply( new MatrixEffectRotate(rotate, axis, innerCenter) );
118
      innerEffects.apply( new MatrixEffectMove(new Static3D( (OUTER-INNER)*LEAF_SIZE/2,(OUTER-INNER)*LEAF_SIZE/2, 0)) );
119 119
      innerEffects.apply( new FragmentEffectChroma(new Static1D(0.5f), new Static3D(1,0,0) ) );
120 120
      innerEffects.apply(blurEffect);
121 121

  
......
125 125
      for(int j=0; j<NUM_LEAVES; j++)
126 126
        {
127 127
        innerLeafEffects[j] = new DistortedEffects();
128
        innerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, innerCenter) );
129 128
        innerLeafEffects[j].apply(new MatrixEffectMove(innerMoveVector));
129
        innerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, innerCenter) );
130 130

  
131 131
        innerNode.attach( mLeaf, innerLeafEffects[j], mesh );
132 132
        }

Also available in: Unified diff