Revision c318fb14
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/DistortedEffects.java | ||
---|---|---|
219 | 219 |
mDebugProgram.useProgram(); |
220 | 220 |
df.setAsOutput(); |
221 | 221 |
|
222 |
Matrix.setIdentityM(mTmpMatrix, 0); |
|
223 |
Matrix.translateM(mTmpMatrix, 0, -df.mWidth/2, df.mHeight/2, -df.mDistance); |
|
224 |
|
|
225 |
Matrix.translateM(mTmpMatrix, 0, minx, -df.mHeight+maxy, 0.0f); |
|
226 |
Matrix.scaleM(mTmpMatrix, 0, (float)(maxx-minx)/(2*halfX), (float)(maxy-miny)/(2*halfY), 1.0f); |
|
227 |
|
|
228 |
Matrix.translateM(mTmpMatrix, 0, halfX,-halfY, 0); |
|
229 |
Matrix.multiplyMM(mMVPMatrix, 0, df.mProjectionMatrix, 0, mTmpMatrix, 0); |
|
222 |
Matrix.setIdentityM( mTmpMatrix, 0); |
|
223 |
Matrix.translateM ( mTmpMatrix, 0, minx-df.mWidth/2, maxy-df.mHeight/2, -df.mDistance); |
|
224 |
Matrix.scaleM ( mTmpMatrix, 0, (float)(maxx-minx)/(2*halfX), (float)(maxy-miny)/(2*halfY), 1.0f); |
|
225 |
Matrix.translateM ( mTmpMatrix, 0, halfX,-halfY, 0); |
|
226 |
Matrix.multiplyMM ( mMVPMatrix, 0, df.mProjectionMatrix, 0, mTmpMatrix, 0); |
|
230 | 227 |
|
231 | 228 |
GLES20.glUniform2f( mObjDH , 2*halfX, 2*halfY); |
232 | 229 |
GLES20.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix , 0); |
... | ... | |
291 | 288 |
} |
292 | 289 |
|
293 | 290 |
/// DEBUG ONLY ////// |
294 |
// displayBoundingRect(halfInputW, halfInputH, halfZ, df, mM.getMVP(), mesh.getBoundingVertices() );
|
|
291 |
displayBoundingRect(halfInputW, halfInputH, halfZ, df, mM.getMVP(), mesh.getBoundingVertices() ); |
|
295 | 292 |
/// END DEBUG /////// |
296 | 293 |
} |
297 | 294 |
|
Also available in: Unified diff
Minor.