Revision 8c1caf83
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/examples/flag/FlagRenderer.java | ||
---|---|---|
150 | 150 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
151 | 151 |
{ |
152 | 152 |
mScreenMin = width<height ? width:height; |
153 |
|
|
154 |
mEffects.abortEffects(EffectTypes.MATRIX); |
|
155 |
float factor; |
|
156 |
|
|
157 |
if( width*mObjHeight > height*mObjWidth ) // screen is more 'horizontal' than the Object |
|
158 |
{ |
|
159 |
factor = (0.8f*height)/mObjHeight; |
|
160 |
} |
|
161 |
else |
|
162 |
{ |
|
163 |
factor = (0.8f*width)/mObjWidth; |
|
164 |
} |
|
153 | 165 |
|
154 |
float q= ((float)width/height)*((float)mObjHeight/mObjWidth);
|
|
155 |
float scale = 0.8f;
|
|
156 |
Static3D center = new Static3D(0,0,0);
|
|
166 |
mEffects.move( new Static3D( (width-factor*mObjWidth)/2 , (height-factor*mObjHeight)/2 , 0) );
|
|
167 |
mEffects.scale(factor);
|
|
168 |
Static3D center = new Static3D(mObjWidth/2,mObjHeight/2, 0);
|
|
157 | 169 |
|
158 |
mEffects.abortEffects(EffectTypes.MATRIX); |
|
159 | 170 |
mEffects.quaternion(mQuatInt1, center); |
160 | 171 |
mEffects.quaternion(mQuatInt2, center); |
161 |
mEffects.scale( q<1 ? (new Static3D(scale,scale*q,scale)) : (new Static3D(scale/q,scale,scale/q)) ); |
|
162 |
|
|
172 |
|
|
163 | 173 |
mScreen.resize(width, height); |
164 | 174 |
} |
165 | 175 |
|
Also available in: Unified diff
Revert "Convert next 4 APPs to the new Matrix effects."
This reverts commit 39a0d81b7482f2925808d661e526aeaa980fb079.