Revision 355c0a07
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/examples/earth/EarthRenderer.java | ||
---|---|---|
64 | 64 |
|
65 | 65 |
class EarthRenderer implements GLSurfaceView.Renderer |
66 | 66 |
{ |
67 |
private static final int SIZE = 500; |
|
68 |
private static final int RADIUS_V= SIZE/ 8; |
|
69 |
private static final int RADIUS_F= SIZE/15; |
|
67 |
private static final float RADIUS_V= 1.0f/ 8; |
|
68 |
private static final float RADIUS_F= 1.0f/15; |
|
70 | 69 |
private static final int LEVEL = 40; |
71 | 70 |
private static final float FOV = 30.0f; |
72 | 71 |
private static final float NEAR = 0.1f; |
... | ... | |
78 | 77 |
private DistortedEffects mEffects; |
79 | 78 |
private MeshBase mMesh; |
80 | 79 |
private DistortedScreen mScreen; |
81 |
private int mObjWidth, mObjHeight, mObjDepth;
|
|
80 |
private float mObjWidth, mObjHeight, mObjDepth;
|
|
82 | 81 |
private Static3D mMove, mScaleFactor; |
83 | 82 |
|
84 | 83 |
private int mScrWidth, mScrHeight; |
... | ... | |
117 | 116 |
scale.add(mScaleFactor); |
118 | 117 |
|
119 | 118 |
mMesh = new MeshSphere(LEVEL); |
120 |
mMesh.setStretch(SIZE,SIZE,SIZE); |
|
121 | 119 |
mTexture = new DistortedTexture(); |
122 | 120 |
|
123 |
mObjWidth = mObjHeight = mObjDepth = SIZE;
|
|
121 |
mObjWidth = mObjHeight = mObjDepth = 1.0f;
|
|
124 | 122 |
|
125 | 123 |
mQuat1 = new Static4D(0,0,0,1); // unity |
126 | 124 |
mQuat2 = new Static4D(0,0,0,1); // quaternions |
... | ... | |
154 | 152 |
{ |
155 | 153 |
mScrWidth = width; |
156 | 154 |
mScrHeight= height; |
157 |
mScreenMin= width<height ? width:height;
|
|
155 |
mScreenMin= Math.min(width, height);
|
|
158 | 156 |
|
159 | 157 |
adjustFactor(); |
160 | 158 |
|
Also available in: Unified diff
Convert Earth to stretchless API.