Revision 01cef452
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/projection/ProjectionRenderer.java | ||
---|---|---|
22 | 22 |
import javax.microedition.khronos.egl.EGLConfig; |
23 | 23 |
import javax.microedition.khronos.opengles.GL10; |
24 | 24 |
|
25 |
import org.distorted.library.effect.VertexEffectDistort;
|
|
25 |
import org.distorted.library.effect.VertexEffectDeform;
|
|
26 | 26 |
import org.distorted.library.main.Distorted; |
27 | 27 |
import org.distorted.library.main.DistortedEffects; |
28 | 28 |
import org.distorted.library.main.DistortedScreen; |
... | ... | |
66 | 66 |
mPoint4 = new Static3D(0,0,0); |
67 | 67 |
mRegion = new Static4D(0,0,0,0); |
68 | 68 |
|
69 |
mEffects.apply( new VertexEffectDistort(mVector, mPoint1, mRegion) );
|
|
70 |
mEffects.apply( new VertexEffectDistort(mVector, mPoint2, mRegion) );
|
|
71 |
mEffects.apply( new VertexEffectDistort(mVector, mPoint3, mRegion) );
|
|
72 |
mEffects.apply( new VertexEffectDistort(mVector, mPoint4, mRegion) );
|
|
69 |
mEffects.apply( new VertexEffectDeform(mVector, mPoint1, mRegion) );
|
|
70 |
mEffects.apply( new VertexEffectDeform(mVector, mPoint2, mRegion) );
|
|
71 |
mEffects.apply( new VertexEffectDeform(mVector, mPoint3, mRegion) );
|
|
72 |
mEffects.apply( new VertexEffectDeform(mVector, mPoint4, mRegion) );
|
|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
122 | 122 |
|
123 | 123 |
int min = width<height ? width:height; |
124 | 124 |
|
125 |
mVector.set(0,0,min/5);
|
|
126 |
mRegion.set(0,0,0,min/5);
|
|
125 |
mVector.set(0,0,min/4);
|
|
126 |
mRegion.set(0,0,0,min/4);
|
|
127 | 127 |
|
128 | 128 |
mPoint1.set( width/4, height/4, 0); |
129 | 129 |
mPoint2.set(3*width/4, height/4, 0); |
... | ... | |
151 | 151 |
|
152 | 152 |
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) |
153 | 153 |
{ |
154 |
VertexEffectDistort.enable();
|
|
154 |
VertexEffectDeform.enable();
|
|
155 | 155 |
|
156 | 156 |
try |
157 | 157 |
{ |
Also available in: Unified diff
Change Distort to Deform in two apps - looks better.