Project

General

Profile

« Previous | Next » 

Revision eb80a7e8

Added by Leszek Koltunski over 7 years ago

Make a MeshCubes object rendered with no effects have its front wall at the screen's surface (so that when we just replace MeshFlat with MeshCubes, it looks more similar)

View differences:

src/main/java/org/distorted/library/EffectQueueMatrix.java
106 106
///////////////////////////////////////////////////////////////////////////////////////////////////
107 107
// here construct the ModelView and the ModelViewProjection Matrices
108 108

  
109
  private void constructMatrices(DistortedOutputSurface projection, float halfX, float halfY)
109
  private void constructMatrices(DistortedOutputSurface projection, float halfX, float halfY, float halfZ)
110 110
    {
111 111
    Matrix.setIdentityM(mViewMatrix, 0);
112 112
    Matrix.translateM(mViewMatrix, 0, -projection.mWidth/2, projection.mHeight/2, -projection.mDistance);
......
182 182
        }
183 183
      }
184 184

  
185
    Matrix.translateM(mViewMatrix, 0, halfX,-halfY, 0);
185
    Matrix.translateM(mViewMatrix, 0, halfX,-halfY,-halfZ);
186 186
    Matrix.multiplyMM(mMVPMatrix, 0, projection.mProjectionMatrix, 0, mViewMatrix, 0);
187 187
    }
188 188

  
......
251 251

  
252 252
  synchronized void send(DistortedOutputSurface projection, float halfX, float halfY, float halfZ)
253 253
    {
254
    constructMatrices(projection,halfX,halfY);
254
    constructMatrices(projection,halfX,halfY,halfZ);
255 255

  
256 256
    GLES30.glUniform3f( mObjDH , halfX, halfY, halfZ);
257 257
    GLES30.glUniformMatrix4fv(mMVMatrixH , 1, false, mViewMatrix, 0);

Also available in: Unified diff