Revision 296d2e73
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/examples/earth/EarthRenderer.java | ||
---|---|---|
24 | 24 |
import android.opengl.GLSurfaceView; |
25 | 25 |
|
26 | 26 |
import org.distorted.examples.R; |
27 |
import org.distorted.library.effect.EffectName; |
|
28 |
import org.distorted.library.effect.EffectType; |
|
27 | 29 |
import org.distorted.library.effect.MatrixEffectMove; |
28 | 30 |
import org.distorted.library.effect.MatrixEffectQuaternion; |
29 | 31 |
import org.distorted.library.effect.MatrixEffectScale; |
... | ... | |
32 | 34 |
import org.distorted.library.main.DistortedScreen; |
33 | 35 |
import org.distorted.library.main.DistortedTexture; |
34 | 36 |
import org.distorted.library.mesh.MeshBase; |
37 |
import org.distorted.library.mesh.MeshSphere; |
|
35 | 38 |
import org.distorted.library.type.DynamicQuat; |
36 | 39 |
import org.distorted.library.type.Static3D; |
37 | 40 |
import org.distorted.library.type.Static4D; |
... | ... | |
46 | 49 |
|
47 | 50 |
class EarthRenderer implements GLSurfaceView.Renderer |
48 | 51 |
{ |
49 |
private static final float FOV = 30.0f; |
|
50 |
private static final float NEAR = 0.1f; |
|
52 |
private static final int SIZE = 100; |
|
53 |
private static final int LEVEL= 32; |
|
54 |
private static final float FOV = 30.0f; |
|
55 |
private static final float NEAR = 0.1f; |
|
51 | 56 |
|
52 | 57 |
private GLSurfaceView mView; |
53 | 58 |
private DistortedTexture mTexture; |
... | ... | |
70 | 75 |
mScale= new Static3D(1,1,1); |
71 | 76 |
mCenter=new Static3D(0,0,0); |
72 | 77 |
|
73 |
EarthActivity act = (EarthActivity)v.getContext(); |
|
74 |
|
|
75 |
mTexture = act.getTexture(); |
|
76 |
mMesh = act.getMesh(); |
|
78 |
mMesh = new MeshSphere(LEVEL); |
|
79 |
mTexture= new DistortedTexture(SIZE,SIZE); |
|
77 | 80 |
|
78 | 81 |
mObjWidth = mTexture.getWidth(); |
79 | 82 |
mObjHeight= mTexture.getHeight(); |
... | ... | |
127 | 130 |
mMesh.setInflate(inflateLevel); |
128 | 131 |
} |
129 | 132 |
|
133 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
134 |
|
|
135 |
void addNewPoint(float x, float y, EffectName effect) |
|
136 |
{ |
|
137 |
|
|
138 |
} |
|
139 |
|
|
140 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
141 |
|
|
142 |
void removeAll() |
|
143 |
{ |
|
144 |
mEffects.abortByType(EffectType.VERTEX); |
|
145 |
mEffects.abortByType(EffectType.FRAGMENT); |
|
146 |
} |
|
147 |
|
|
130 | 148 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
131 | 149 |
|
132 | 150 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
Also available in: Unified diff
Advances with the Earth app - prepare it to checking if any FRAGMENT or VERTEX effect correctly works on a Sphere mesh.