Revision 16b22aab
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java | ||
---|---|---|
60 | 60 |
private Static3D[] mMoveVector; |
61 | 61 |
private Static1D[] mAlphaVector; |
62 | 62 |
private DistortedScreen mScreen; |
63 |
private Static3D mMove, mScale, mCenter;
|
|
63 |
private Static3D mScale;
|
|
64 | 64 |
private PostprocessEffectBlur[] mBlur; |
65 | 65 |
private boolean[] mBlurApplied; |
66 | 66 |
private DistortedEffects[] mEffects; |
... | ... | |
92 | 92 |
|
93 | 93 |
FragmentEffectAlpha[] alpha = new FragmentEffectAlpha[NUM_OBJECTS]; |
94 | 94 |
|
95 |
mMove = new Static3D(0,0,0); |
|
96 | 95 |
mScale = new Static3D(1.0f,1.0f,1.0f); |
97 |
mCenter= new Static3D(0,0,0);
|
|
96 |
Static3D center= new Static3D(0,0,0);
|
|
98 | 97 |
|
99 |
MatrixEffectMove moveEffect = new MatrixEffectMove(mMove); |
|
100 | 98 |
MatrixEffectScale scaleEffect = new MatrixEffectScale(mScale); |
101 |
MatrixEffectQuaternion quatEffect1 = new MatrixEffectQuaternion(mQuat1, mCenter);
|
|
102 |
MatrixEffectQuaternion quatEffect2 = new MatrixEffectQuaternion(mQuat2, mCenter);
|
|
99 |
MatrixEffectQuaternion quatEffect1 = new MatrixEffectQuaternion(mQuat1, center);
|
|
100 |
MatrixEffectQuaternion quatEffect2 = new MatrixEffectQuaternion(mQuat2, center);
|
|
103 | 101 |
|
104 | 102 |
|
105 | 103 |
for(int i=0; i<NUM_OBJECTS; i++) |
... | ... | |
114 | 112 |
|
115 | 113 |
mEffects[i].apply(mBlur[i]); |
116 | 114 |
mEffects[i].apply(alpha[i]); |
117 |
mEffects[i].apply(moveEffect); |
|
118 | 115 |
mEffects[i].apply(scaleEffect); |
119 | 116 |
mEffects[i].apply(quatEffect1); |
120 | 117 |
mEffects[i].apply(quatEffect2); |
... | ... | |
194 | 191 |
{ |
195 | 192 |
for(int i=0; i<NUM_OBJECTS; i++) |
196 | 193 |
{ |
197 |
mTex[i].setColor(OBJECTS[NUM * i + 3]); |
|
194 |
mTex[i].setColorARGB(OBJECTS[NUM * i + 3]);
|
|
198 | 195 |
} |
199 | 196 |
|
200 | 197 |
PostprocessEffectBlur.enable(); |
... | ... | |
219 | 216 |
|
220 | 217 |
float factor = 0.65f*mScreenMin/OBJ_SIZE; |
221 | 218 |
mScale.set(factor,factor,factor); |
222 |
mCenter.set((float)OBJ_SIZE/2, (float)OBJ_SIZE/2, 0 ); |
|
223 |
mMove.set( (width -factor*OBJ_SIZE)/2 ,(height-factor*OBJ_SIZE)/2 ,0); |
|
224 | 219 |
|
225 | 220 |
for(int i=0; i<NUM_OBJECTS; i++) |
226 | 221 |
{ |
Also available in: Unified diff
Fix several more apps for the 'center-of-matrix-effects-in-screen-center' change.