Revision 16b22aab
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java | ||
---|---|---|
73 | 73 |
private PostprocessEffectBlur mBlur; |
74 | 74 |
private int mDistance; |
75 | 75 |
private boolean[] mBlurStatus; |
76 |
private Static3D mMove, mScale, mCenter;
|
|
76 |
private Static3D mScale;
|
|
77 | 77 |
|
78 | 78 |
Static4D mQuat1, mQuat2; |
79 | 79 |
int mScreenMin; |
... | ... | |
121 | 121 |
mBlurStatus[0] = true; |
122 | 122 |
effects[0].apply(mBlur); |
123 | 123 |
|
124 |
mMove = new Static3D(0,0,0); |
|
125 | 124 |
mScale = new Static3D(1,1,1); |
126 |
mCenter = new Static3D(0,0,0);
|
|
125 |
Static3D center = new Static3D(0,0,0);
|
|
127 | 126 |
|
128 |
MatrixEffectMove moveEffect = new MatrixEffectMove(mMove); |
|
129 | 127 |
MatrixEffectScale scaleEffect = new MatrixEffectScale(mScale); |
130 |
MatrixEffectQuaternion quatEffect1 = new MatrixEffectQuaternion(mQuat1, mCenter);
|
|
131 |
MatrixEffectQuaternion quatEffect2 = new MatrixEffectQuaternion(mQuat2, mCenter);
|
|
128 |
MatrixEffectQuaternion quatEffect1 = new MatrixEffectQuaternion(mQuat1, center);
|
|
129 |
MatrixEffectQuaternion quatEffect2 = new MatrixEffectQuaternion(mQuat2, center);
|
|
132 | 130 |
|
133 | 131 |
for(int i=0; i<NUM_OBJECTS; i++) |
134 | 132 |
{ |
135 |
effects[i].apply(moveEffect); |
|
136 | 133 |
effects[i].apply(scaleEffect); |
137 | 134 |
effects[i].apply(quatEffect1); |
138 | 135 |
effects[i].apply(quatEffect2); |
... | ... | |
165 | 162 |
|
166 | 163 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
167 | 164 |
{ |
168 |
mScreenMin = width<height ? width:height; |
|
169 |
|
|
170 |
float factor = 0.15f*mScreenMin/OBJ_SIZE; |
|
165 |
mScreenMin = width<height ? width:height; |
|
166 |
float factor= 0.15f*mScreenMin/OBJ_SIZE; |
|
171 | 167 |
mScale.set(factor,factor,factor); |
172 |
mCenter.set((float)OBJ_SIZE/2, (float)OBJ_SIZE/2, (float)OBJ_SIZE/2 ); |
|
173 |
mMove.set( (width -factor*OBJ_SIZE)/2 ,(height-factor*OBJ_SIZE)/2 , -factor*OBJ_SIZE); |
|
174 | 168 |
computeMoveVectors(); |
175 | 169 |
mScreen.resize(width, height); |
176 | 170 |
} |
... | ... | |
217 | 211 |
|
218 | 212 |
private void computeMoveVectors() |
219 | 213 |
{ |
220 |
float size= 0.026f*OBJ_SIZE*mDistance;
|
|
214 |
float size= 0.020f*OBJ_SIZE*mDistance;
|
|
221 | 215 |
|
222 | 216 |
for(int i=0; i<NUM_OBJECTS; i++) |
223 | 217 |
{ |
... | ... | |
268 | 262 |
{ |
269 | 263 |
android.util.Log.e("renderer", "Error, number: "+number+" checked: "+checked ); |
270 | 264 |
} |
271 |
|
|
272 |
//android.util.Log.d("renderer", "setting box "+number+" BLUR state to "+checked); |
|
273 | 265 |
} |
274 | 266 |
} |
Also available in: Unified diff
Fix several more apps for the 'center-of-matrix-effects-in-screen-center' change.