Revision 8eed34d3
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
---|---|---|
65 | 65 |
private MeshRectangles mMesh; |
66 | 66 |
private DistortedScreen mScreen; |
67 | 67 |
private int mObjHeight, mObjWidth; |
68 |
private Static3D mScale, mCenter; |
|
69 |
private Static3D mSwirl1, mSwirl2, mDeform1, mDeform2; |
|
68 |
private Static3D mScale, mSwirl1, mSwirl2, mDeform1, mDeform2; |
|
70 | 69 |
|
71 | 70 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
72 | 71 |
|
... | ... | |
88 | 87 |
mDeform1= new Static3D(0,0,0); |
89 | 88 |
mDeform2= new Static3D(0,0,0); |
90 | 89 |
mScale = new Static3D(1,1,1); |
91 |
mCenter = new Static3D(0,0,0); |
|
92 | 90 |
|
93 | 91 |
mEffects = new DistortedEffects(); |
94 | 92 |
mEffects.apply(new MatrixEffectScale(mScale)); |
... | ... | |
112 | 110 |
dDeform.add(mDeform1); |
113 | 111 |
dDeform.add(mDeform2); |
114 | 112 |
|
115 |
if( !mEffects.apply( new VertexEffectDeform(dDeform,mCenter) ) )
|
|
113 |
if( !mEffects.apply( new VertexEffectDeform(dDeform,new Static3D(0,0,0)) ) )
|
|
116 | 114 |
{ |
117 | 115 |
Log.e("Check", "Failed to add Deform effect!"); |
118 | 116 |
} |
... | ... | |
189 | 187 |
mScreen.detachAll(); |
190 | 188 |
mScreen.attach(mTexture,mEffects,mMesh); |
191 | 189 |
|
192 |
mSwirl1.set ( 0, mObjHeight/2, 0); |
|
193 |
mSwirl2.set (mObjWidth , mObjHeight/2, 0); |
|
194 |
mDeform1.set( 0, 0 , 0); |
|
195 |
mDeform2.set( 0, mObjHeight , 0); |
|
196 |
mCenter.set (mObjWidth/2, 0 , 0); |
|
190 |
mSwirl1.set (-mObjWidth/2, 0, 0); |
|
191 |
mSwirl2.set ( mObjWidth/2, 0, 0); |
|
192 |
mDeform1.set( 0, 0, 0); |
|
193 |
mDeform2.set( 0, mObjHeight, 0); |
|
197 | 194 |
|
198 | 195 |
try |
199 | 196 |
{ |
Also available in: Unified diff
Moving the Vertex and Fragment centers of effect to the center of the Mesh.