Project

General

Profile

« Previous | Next » 

Revision e83350b4

Added by Leszek Koltunski over 5 years ago

Progress with the Earth app.

View differences:

src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java
36 36
import org.distorted.library.main.DistortedTexture;
37 37
import org.distorted.library.mesh.MeshBase;
38 38
import org.distorted.library.mesh.MeshFlat;
39
import org.distorted.library.mesh.MeshSphere;
39 40
import org.distorted.library.type.Static3D;
40 41
import org.distorted.library.type.Static4D;
41 42

  
......
63 64
    private boolean mShowingRegion=false;
64 65
    private float mFactorObj, mFactorReg;
65 66
    private int mWidth;
67
    private float mFactor;
66 68

  
67 69
    Static4D mQuat1, mQuat2;
68 70
    int mScreenMin;
......
97 99
      MeshBase mesh    = act.getMesh();
98 100
      MeshFlat quad    = new MeshFlat(1,1);
99 101

  
102
      mFactor = mesh instanceof MeshSphere ? 1.0f : 0.7f;
103

  
100 104
      mObjWidth = mObjectTexture.getWidth();
101 105
      mObjHeight= mObjectTexture.getHeight();
102 106
      mObjDepth = mObjectTexture.getDepth(mesh);
......
235 239

  
236 240
      if( width*mObjHeight > height*mObjWidth ) // screen is more 'horizontal' than the Object
237 241
        {
238
        mFactorObj = (0.70f*height)/mObjHeight;
239
        factorCen  = (0.08f*height)/centerSize;
242
        mFactorObj = (mFactor*height)/mObjHeight;
243
        factorCen  = (0.08f  *height)/centerSize;
240 244
        }
241 245
      else
242 246
        {
243
        mFactorObj = (0.70f*width)/mObjWidth;
244
        factorCen  = (0.08f*width)/centerSize;
247
        mFactorObj = (mFactor*width)/mObjWidth;
248
        factorCen  = (0.08f  *width)/centerSize;
245 249
        }
246 250

  
247 251
      Effects3DActivity2 act = (Effects3DActivity2)mView.getContext();

Also available in: Unified diff