Project

General

Profile

« Previous | Next » 

Revision 8a99c681

Added by Leszek Koltunski about 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/examples/effects3d/Effects3DRenderer.java
21 21

  
22 22
import android.graphics.Bitmap;
23 23
import android.graphics.BitmapFactory;
24
import android.opengl.GLES30;
25 24
import android.opengl.GLSurfaceView;
26 25

  
27 26
import org.distorted.examples.R;
......
202 201
      mFactorReg = 2*mFactorObj*act.getRegionR()/regionSize;
203 202
      mRegionScalePoint.set(mFactorReg,mFactorReg,mFactorReg);
204 203

  
205
      Static3D rotateObj = new Static3D(mObjWidth/2,mObjHeight/2, 0);
204
      Static3D rotateObj = new Static3D( (float)mObjWidth/2, (float)mObjHeight/2, -(float)mObjDepth/2 );
206 205

  
207 206
      mObjectEffects.move( new Static3D( (width-mFactorObj*mObjWidth)/2 , (height-mFactorObj*mObjHeight)/2 , 0) );
208 207
      mObjectEffects.scale(mFactorObj);
......
215 214
      mCenterEffects.quaternion(mQuatInt2, rotateCen);
216 215

  
217 216
      mCenterEffects.move( new Static3D( (width -factorCen*centerSize-mFactorObj*mObjWidth )/2 ,
218
                                  (height-factorCen*centerSize-mFactorObj*mObjHeight)/2 , mFactorObj*mObjDepth/2+10) );
217
                                  (height-factorCen*centerSize-mFactorObj*mObjHeight)/2 , 10) );
219 218
      mCenterEffects.move(mCenterInter);
220 219
      mCenterEffects.scale(factorCen);
221 220

  
......
223 222
      mRegionEffects.quaternion(mQuatInt2, rotateCen);
224 223

  
225 224
      mRegionEffects.move( new Static3D( (width -mFactorObj*mObjWidth )/2 ,
226
                                  (height-mFactorObj*mObjHeight)/2 , mFactorObj*mObjDepth/2+12) );
225
                                  (height-mFactorObj*mObjHeight)/2 , 12) );
227 226
      mRegionEffects.move(mCenterInter);
228 227
      mRegionEffects.move(mRegionInter);
229 228
      mRegionEffects.scale(mRegionScaleInter);

Also available in: Unified diff