Revision 16b22aab
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.distorted.library.effect.EffectType; |
31 | 31 |
import org.distorted.library.effect.FragmentEffectChroma; |
32 |
import org.distorted.library.effect.MatrixEffectMove; |
|
33 | 32 |
import org.distorted.library.effect.MatrixEffectScale; |
34 | 33 |
import org.distorted.library.effect.VertexEffectDeform; |
35 | 34 |
import org.distorted.library.effect.VertexEffectSwirl; |
... | ... | |
66 | 65 |
private MeshFlat mMesh; |
67 | 66 |
private DistortedScreen mScreen; |
68 | 67 |
private int mObjHeight, mObjWidth; |
69 |
private Static3D mMove, mScale, mCenter;
|
|
68 |
private Static3D mScale, mCenter; |
|
70 | 69 |
private Static3D mSwirl1, mSwirl2, mDeform1, mDeform2; |
71 | 70 |
|
72 | 71 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
88 | 87 |
mSwirl2 = new Static3D(0,0,0); |
89 | 88 |
mDeform1= new Static3D(0,0,0); |
90 | 89 |
mDeform2= new Static3D(0,0,0); |
91 |
mMove = new Static3D(0,0,0); |
|
92 | 90 |
mScale = new Static3D(1,1,1); |
93 | 91 |
mCenter = new Static3D(0,0,0); |
94 | 92 |
|
95 | 93 |
mEffects = new DistortedEffects(); |
96 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
97 | 94 |
mEffects.apply(new MatrixEffectScale(mScale)); |
98 | 95 |
|
99 | 96 |
// Try adding 2 Vertex Effects to the Bitmap. |
... | ... | |
152 | 149 |
|
153 | 150 |
float factor = xW>xH ? SCALE*xH : SCALE*xW; |
154 | 151 |
|
155 |
mMove.set( (width-factor*mObjWidth)/2 , (height-factor*mObjHeight)/2 , 0); |
|
156 | 152 |
mScale.set(factor,factor,factor); |
157 | 153 |
|
158 | 154 |
mScreen.resize(width,height); |
Also available in: Unified diff
Fix several more apps for the 'center-of-matrix-effects-in-screen-center' change.