Revision b01acdaf
Added by Leszek Koltunski almost 9 years ago
| src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java | ||
|---|---|---|
| 28 | 28 |
import org.distorted.library.Distorted; |
| 29 | 29 |
import org.distorted.library.DistortedEffects; |
| 30 | 30 |
import org.distorted.library.DistortedFramebuffer; |
| 31 |
import org.distorted.library.GridFlat;
|
|
| 31 |
import org.distorted.library.MeshFlat;
|
|
| 32 | 32 |
import org.distorted.library.DistortedTexture; |
| 33 | 33 |
import org.distorted.library.EffectTypes; |
| 34 | 34 |
import org.distorted.library.type.Static3D; |
| ... | ... | |
| 46 | 46 |
private GLSurfaceView mView; |
| 47 | 47 |
private DistortedEffects mEffects; |
| 48 | 48 |
private DistortedTexture mTexture; |
| 49 |
private GridFlat mGrid;
|
|
| 49 |
private MeshFlat mMesh;
|
|
| 50 | 50 |
private DistortedFramebuffer mScreen; |
| 51 | 51 |
private AroundTheWorldEffectsManager mManager; |
| 52 | 52 |
private int mObjWidth, mObjHeight; |
| ... | ... | |
| 77 | 77 |
public void onDrawFrame(GL10 glUnused) |
| 78 | 78 |
{
|
| 79 | 79 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 80 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 80 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 81 | 81 |
} |
| 82 | 82 |
|
| 83 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 132 | 132 |
mTexture = new DistortedTexture(mObjWidth,mObjHeight); |
| 133 | 133 |
mTexture.setTexture(bitmap); |
| 134 | 134 |
|
| 135 |
mGrid = new GridFlat(30,30*mObjHeight/mObjWidth);
|
|
| 135 |
mMesh = new MeshFlat(30,30*mObjHeight/mObjWidth);
|
|
| 136 | 136 |
|
| 137 | 137 |
try |
| 138 | 138 |
{
|
| src/main/java/org/distorted/examples/bean/BeanRenderer.java | ||
|---|---|---|
| 32 | 32 |
import org.distorted.library.EffectTypes; |
| 33 | 33 |
import org.distorted.library.Distorted; |
| 34 | 34 |
import org.distorted.library.DistortedTexture; |
| 35 |
import org.distorted.library.GridFlat;
|
|
| 35 |
import org.distorted.library.MeshFlat;
|
|
| 36 | 36 |
import org.distorted.library.type.Dynamic3D; |
| 37 | 37 |
import org.distorted.library.type.Static3D; |
| 38 | 38 |
import org.distorted.library.type.Static4D; |
| ... | ... | |
| 50 | 50 |
private DistortedTexture mTexture; |
| 51 | 51 |
private DistortedEffects mEffects; |
| 52 | 52 |
private DistortedFramebuffer mScreen; |
| 53 |
private GridFlat mGrid;
|
|
| 53 |
private MeshFlat mMesh;
|
|
| 54 | 54 |
private int bmpHeight, bmpWidth; |
| 55 | 55 |
|
| 56 | 56 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 97 | 97 |
public void onDrawFrame(GL10 glUnused) |
| 98 | 98 |
{
|
| 99 | 99 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 100 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 100 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 101 | 101 |
} |
| 102 | 102 |
|
| 103 | 103 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 153 | 153 |
|
| 154 | 154 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 155 | 155 |
mTexture.setTexture(bitmap); |
| 156 |
mGrid = new GridFlat(25,25*bmpHeight/bmpWidth);
|
|
| 156 |
mMesh = new MeshFlat(25,25*bmpHeight/bmpWidth);
|
|
| 157 | 157 |
|
| 158 | 158 |
try |
| 159 | 159 |
{
|
| src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java | ||
|---|---|---|
| 30 | 30 |
import org.distorted.library.DistortedEffects; |
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 | 32 |
import org.distorted.library.DistortedTexture; |
| 33 |
import org.distorted.library.GridFlat;
|
|
| 33 |
import org.distorted.library.MeshFlat;
|
|
| 34 | 34 |
import org.distorted.library.EffectTypes; |
| 35 | 35 |
import org.distorted.library.type.Dynamic1D; |
| 36 | 36 |
import org.distorted.library.type.Dynamic3D; |
| ... | ... | |
| 50 | 50 |
private GLSurfaceView mView; |
| 51 | 51 |
private DistortedEffects mEffects; |
| 52 | 52 |
private DistortedTexture mTexture; |
| 53 |
private GridFlat mGrid;
|
|
| 53 |
private MeshFlat mMesh;
|
|
| 54 | 54 |
private DistortedFramebuffer mScreen; |
| 55 | 55 |
private int bmpHeight, bmpWidth; |
| 56 | 56 |
|
| ... | ... | |
| 60 | 60 |
{
|
| 61 | 61 |
mView = v; |
| 62 | 62 |
|
| 63 |
mGrid = new GridFlat(1,1); // no vertex effects, grid can be a (1x1) quad.
|
|
| 63 |
mMesh = new MeshFlat(1,1); // no vertex effects, grid can be a (1x1) quad.
|
|
| 64 | 64 |
mEffects = new DistortedEffects(); |
| 65 | 65 |
|
| 66 | 66 |
Static4D chromaRegion= new Static4D( 530, 200,100,100); |
| ... | ... | |
| 86 | 86 |
public void onDrawFrame(GL10 glUnused) |
| 87 | 87 |
{
|
| 88 | 88 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 89 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 89 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 90 | 90 |
} |
| 91 | 91 |
|
| 92 | 92 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
|---|---|---|
| 31 | 31 |
import org.distorted.library.DistortedEffects; |
| 32 | 32 |
import org.distorted.library.DistortedFramebuffer; |
| 33 | 33 |
import org.distorted.library.DistortedTexture; |
| 34 |
import org.distorted.library.GridFlat;
|
|
| 34 |
import org.distorted.library.MeshFlat;
|
|
| 35 | 35 |
import org.distorted.library.EffectTypes; |
| 36 | 36 |
import org.distorted.library.type.Dynamic3D; |
| 37 | 37 |
import org.distorted.library.type.Static1D; |
| ... | ... | |
| 58 | 58 |
private GLSurfaceView mView; |
| 59 | 59 |
private DistortedTexture mTexture; |
| 60 | 60 |
private DistortedEffects mEffects; |
| 61 |
private GridFlat mGrid;
|
|
| 61 |
private MeshFlat mMesh;
|
|
| 62 | 62 |
private DistortedFramebuffer mScreen; |
| 63 | 63 |
private int bmpHeight, bmpWidth; |
| 64 | 64 |
|
| ... | ... | |
| 82 | 82 |
public void onDrawFrame(GL10 glUnused) |
| 83 | 83 |
{
|
| 84 | 84 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 85 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 85 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 86 | 86 |
} |
| 87 | 87 |
|
| 88 | 88 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 138 | 138 |
|
| 139 | 139 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 140 | 140 |
mTexture.setTexture(bitmap); |
| 141 |
mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
|
|
| 141 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
| 142 | 142 |
|
| 143 | 143 |
// Try adding 2 Vertex Effects to the Bitmap. |
| 144 | 144 |
// This will fail if we have set maxVertexEffects to something < 2. |
| src/main/java/org/distorted/examples/cubes/CubesActivity.java | ||
|---|---|---|
| 22 | 22 |
import org.distorted.library.Distorted; |
| 23 | 23 |
import org.distorted.examples.R; |
| 24 | 24 |
import org.distorted.library.DistortedTexture; |
| 25 |
import org.distorted.library.GridObject;
|
|
| 26 |
import org.distorted.library.GridCubes;
|
|
| 25 |
import org.distorted.library.MeshObject;
|
|
| 26 |
import org.distorted.library.MeshCubes;
|
|
| 27 | 27 |
|
| 28 | 28 |
import android.app.Activity; |
| 29 | 29 |
import android.opengl.GLSurfaceView; |
| ... | ... | |
| 49 | 49 |
private LinearLayout mLay; |
| 50 | 50 |
private boolean[] mShape; |
| 51 | 51 |
private DistortedTexture mTexture; |
| 52 |
private GridObject mGrid;
|
|
| 52 |
private MeshObject mMesh;
|
|
| 53 | 53 |
|
| 54 | 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 55 | 55 |
|
| ... | ... | |
| 199 | 199 |
for(int i=0; i<mNumRows*mNumCols; i++) |
| 200 | 200 |
str += mShape[i] ? "1" : "0"; |
| 201 | 201 |
|
| 202 |
mGrid = new GridCubes(mNumCols, str, false);
|
|
| 202 |
mMesh = new MeshCubes(mNumCols, str, false);
|
|
| 203 | 203 |
mTexture = new DistortedTexture(mNumCols,mNumRows); |
| 204 | 204 |
|
| 205 | 205 |
setContentView(R.layout.cubeslayout); |
| ... | ... | |
| 214 | 214 |
|
| 215 | 215 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 216 | 216 |
|
| 217 |
public GridObject getGrid()
|
|
| 217 |
public MeshObject getGrid()
|
|
| 218 | 218 |
{
|
| 219 |
return mGrid;
|
|
| 219 |
return mMesh;
|
|
| 220 | 220 |
} |
| 221 | 221 |
} |
| src/main/java/org/distorted/examples/cubes/CubesRenderer.java | ||
|---|---|---|
| 30 | 30 |
import org.distorted.library.DistortedEffects; |
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 | 32 |
import org.distorted.library.DistortedTexture; |
| 33 |
import org.distorted.library.GridObject;
|
|
| 33 |
import org.distorted.library.MeshObject;
|
|
| 34 | 34 |
import org.distorted.library.EffectTypes; |
| 35 | 35 |
import org.distorted.library.type.DynamicQuat; |
| 36 | 36 |
import org.distorted.library.type.Static4D; |
| ... | ... | |
| 49 | 49 |
private GLSurfaceView mView; |
| 50 | 50 |
private DistortedTexture mTexture; |
| 51 | 51 |
private DistortedEffects mEffects; |
| 52 |
private GridObject mGrid;
|
|
| 52 |
private MeshObject mMesh;
|
|
| 53 | 53 |
private DistortedFramebuffer mScreen; |
| 54 | 54 |
private DynamicQuat mQuatInt1, mQuatInt2; |
| 55 | 55 |
private int mObjWidth, mObjHeight; |
| ... | ... | |
| 67 | 67 |
|
| 68 | 68 |
mEffects = new DistortedEffects(); |
| 69 | 69 |
mTexture = act.getTexture(); |
| 70 |
mGrid = act.getGrid();
|
|
| 70 |
mMesh = act.getGrid();
|
|
| 71 | 71 |
|
| 72 | 72 |
mObjWidth = mTexture.getWidth(); |
| 73 | 73 |
mObjHeight= mTexture.getHeight(); |
| ... | ... | |
| 89 | 89 |
public void onDrawFrame(GL10 glUnused) |
| 90 | 90 |
{
|
| 91 | 91 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 92 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 92 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 93 | 93 |
} |
| 94 | 94 |
|
| 95 | 95 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/deform/DeformRenderer.java | ||
|---|---|---|
| 26 | 26 |
import org.distorted.library.DistortedEffects; |
| 27 | 27 |
import org.distorted.library.DistortedFramebuffer; |
| 28 | 28 |
import org.distorted.library.DistortedTexture; |
| 29 |
import org.distorted.library.GridObject;
|
|
| 30 |
import org.distorted.library.GridFlat;
|
|
| 29 |
import org.distorted.library.MeshObject;
|
|
| 30 |
import org.distorted.library.MeshFlat;
|
|
| 31 | 31 |
|
| 32 | 32 |
import org.distorted.library.EffectNames; |
| 33 | 33 |
import org.distorted.library.EffectTypes; |
| ... | ... | |
| 53 | 53 |
private GLSurfaceView mView; |
| 54 | 54 |
private DistortedTexture fpsTexture, stretchTexture; |
| 55 | 55 |
private DistortedEffects fpsEffects, stretchEffects; |
| 56 |
private GridObject fpsGrid, stretchGrid;
|
|
| 56 |
private MeshObject fpsMesh, stretchMesh;
|
|
| 57 | 57 |
private DistortedFramebuffer mScreen; |
| 58 | 58 |
private Static3D touchPoint; |
| 59 | 59 |
|
| ... | ... | |
| 182 | 182 |
|
| 183 | 183 |
long time = System.currentTimeMillis(); |
| 184 | 184 |
|
| 185 |
mScreen.renderTo(stretchTexture,stretchGrid,stretchEffects,time);
|
|
| 185 |
mScreen.renderTo(stretchTexture, stretchMesh,stretchEffects,time);
|
|
| 186 | 186 |
|
| 187 | 187 |
mPaint.setColor(0xffffffff); |
| 188 | 188 |
fpsCanvas.drawRect(0, 0, fpsW, fpsH, mPaint); |
| ... | ... | |
| 190 | 190 |
fpsCanvas.drawText(fpsString, fpsW/2, 5*fpsH/6, mPaint); |
| 191 | 191 |
|
| 192 | 192 |
fpsTexture.setTexture(fpsBitmap); |
| 193 |
mScreen.renderTo(fpsTexture,fpsGrid,fpsEffects,time);
|
|
| 193 |
mScreen.renderTo(fpsTexture, fpsMesh,fpsEffects,time);
|
|
| 194 | 194 |
|
| 195 | 195 |
computeFPS(time); |
| 196 | 196 |
} |
| ... | ... | |
| 244 | 244 |
Canvas stretchCanvas; |
| 245 | 245 |
|
| 246 | 246 |
stretchTexture = new DistortedTexture(w,h); |
| 247 |
stretchGrid = new GridFlat(50,50*h/w);
|
|
| 247 |
stretchMesh = new MeshFlat(50,50*h/w);
|
|
| 248 | 248 |
Bitmap stretchBitmap = Bitmap.createBitmap(w,h, Bitmap.Config.ARGB_8888); |
| 249 | 249 |
stretchCanvas = new Canvas(stretchBitmap); |
| 250 | 250 |
|
| ... | ... | |
| 266 | 266 |
touchPoint= new Static3D(0,0,0); |
| 267 | 267 |
|
| 268 | 268 |
fpsTexture = new DistortedTexture(fpsW,fpsH); |
| 269 |
fpsGrid = new GridFlat(1,1);
|
|
| 269 |
fpsMesh = new MeshFlat(1,1);
|
|
| 270 | 270 |
|
| 271 | 271 |
fpsBitmap = Bitmap.createBitmap(fpsW,fpsH, Bitmap.Config.ARGB_8888); |
| 272 | 272 |
fpsCanvas = new Canvas(fpsBitmap); |
| src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java | ||
|---|---|---|
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 | 32 |
import org.distorted.library.DistortedTexture; |
| 33 | 33 |
import org.distorted.library.DistortedEffects; |
| 34 |
import org.distorted.library.GridFlat;
|
|
| 34 |
import org.distorted.library.MeshFlat;
|
|
| 35 | 35 |
import org.distorted.library.EffectTypes; |
| 36 | 36 |
import org.distorted.library.type.Dynamic3D; |
| 37 | 37 |
import org.distorted.library.type.Static1D; |
| ... | ... | |
| 52 | 52 |
private GLSurfaceView mView; |
| 53 | 53 |
private DistortedTexture[] mTexture; |
| 54 | 54 |
private DistortedEffects[] mEffects; |
| 55 |
private GridFlat mGrid;
|
|
| 55 |
private MeshFlat mMesh;
|
|
| 56 | 56 |
private DistortedFramebuffer mScreen; |
| 57 | 57 |
private int bmpHeight, bmpWidth; |
| 58 | 58 |
|
| ... | ... | |
| 111 | 111 |
|
| 112 | 112 |
long time = System.currentTimeMillis(); |
| 113 | 113 |
|
| 114 |
for(int i=NUM-1; i>=0; i--) mScreen.renderTo(mTexture[i], mGrid, mEffects[i], time);
|
|
| 114 |
for(int i=NUM-1; i>=0; i--) mScreen.renderTo(mTexture[i], mMesh, mEffects[i], time);
|
|
| 115 | 115 |
} |
| 116 | 116 |
|
| 117 | 117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 171 | 171 |
mTexture[1].setTexture(bitmap1); |
| 172 | 172 |
mTexture[2].setTexture(bitmap2); |
| 173 | 173 |
|
| 174 |
mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
|
|
| 174 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
| 175 | 175 |
|
| 176 | 176 |
try |
| 177 | 177 |
{
|
| src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java | ||
|---|---|---|
| 30 | 30 |
import org.distorted.library.Distorted; |
| 31 | 31 |
import org.distorted.library.DistortedEffects; |
| 32 | 32 |
import org.distorted.library.DistortedFramebuffer; |
| 33 |
import org.distorted.library.GridFlat;
|
|
| 33 |
import org.distorted.library.MeshFlat;
|
|
| 34 | 34 |
import org.distorted.library.DistortedTexture; |
| 35 | 35 |
import org.distorted.library.EffectTypes; |
| 36 | 36 |
import org.distorted.library.type.Dynamic1D; |
| ... | ... | |
| 53 | 53 |
private GLSurfaceView mView; |
| 54 | 54 |
private DistortedEffects[] mEffects; |
| 55 | 55 |
private DistortedTexture mTexture; |
| 56 |
private GridFlat mGrid;
|
|
| 56 |
private MeshFlat mMesh;
|
|
| 57 | 57 |
private DistortedFramebuffer mScreen; |
| 58 | 58 |
private int bmpHeight, bmpWidth; |
| 59 | 59 |
|
| ... | ... | |
| 105 | 105 |
|
| 106 | 106 |
long time = System.currentTimeMillis(); |
| 107 | 107 |
|
| 108 |
for(int i=NUM-1; i>=0; i--) mScreen.renderTo(mTexture, mGrid, mEffects[i], time);
|
|
| 108 |
for(int i=NUM-1; i>=0; i--) mScreen.renderTo(mTexture, mMesh, mEffects[i], time);
|
|
| 109 | 109 |
} |
| 110 | 110 |
|
| 111 | 111 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 169 | 169 |
bmpHeight = bitmap.getHeight(); |
| 170 | 170 |
bmpWidth = bitmap.getWidth(); |
| 171 | 171 |
|
| 172 |
mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
|
|
| 172 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
| 173 | 173 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 174 | 174 |
|
| 175 | 175 |
mTexture.setTexture(bitmap); |
| src/main/java/org/distorted/examples/dynamic/DynamicRenderer.java | ||
|---|---|---|
| 31 | 31 |
|
| 32 | 32 |
import org.distorted.library.DistortedEffects; |
| 33 | 33 |
import org.distorted.library.DistortedFramebuffer; |
| 34 |
import org.distorted.library.GridFlat;
|
|
| 34 |
import org.distorted.library.MeshFlat;
|
|
| 35 | 35 |
import org.distorted.library.DistortedTexture; |
| 36 | 36 |
import org.distorted.library.Distorted; |
| 37 | 37 |
|
| ... | ... | |
| 43 | 43 |
private DistortedTexture mTexture; |
| 44 | 44 |
private DistortedEffects mEffects; |
| 45 | 45 |
private DistortedFramebuffer mScreen; |
| 46 |
private GridFlat mGrid;
|
|
| 46 |
private MeshFlat mMesh;
|
|
| 47 | 47 |
private Canvas mCanvas; |
| 48 | 48 |
private Bitmap mBitmap; |
| 49 | 49 |
private Paint mPaint; |
| ... | ... | |
| 61 | 61 |
mPaint.setStyle(Style.FILL); |
| 62 | 62 |
|
| 63 | 63 |
mView = v; |
| 64 |
mGrid = new GridFlat(1,1);
|
|
| 64 |
mMesh = new MeshFlat(1,1);
|
|
| 65 | 65 |
mEffects = new DistortedEffects(); |
| 66 | 66 |
mScreen = new DistortedFramebuffer(0); |
| 67 | 67 |
} |
| ... | ... | |
| 106 | 106 |
mCanvas.drawRect(0, 0, texW, texH, mPaint); |
| 107 | 107 |
mView.drawCurve(mCanvas,time); |
| 108 | 108 |
mTexture.setTexture(mBitmap); |
| 109 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 109 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 110 | 110 |
} |
| 111 | 111 |
|
| 112 | 112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/effectqueue/EffectQueueRenderer.java | ||
|---|---|---|
| 31 | 31 |
|
| 32 | 32 |
import org.distorted.library.DistortedEffects; |
| 33 | 33 |
import org.distorted.library.DistortedFramebuffer; |
| 34 |
import org.distorted.library.GridFlat;
|
|
| 34 |
import org.distorted.library.MeshFlat;
|
|
| 35 | 35 |
import org.distorted.library.DistortedTexture; |
| 36 | 36 |
import org.distorted.library.Distorted; |
| 37 | 37 |
import org.distorted.library.EffectNames; |
| ... | ... | |
| 53 | 53 |
private int texWidth, texHeight; |
| 54 | 54 |
|
| 55 | 55 |
private DistortedTexture mTexture; |
| 56 |
private GridFlat mGrid;
|
|
| 56 |
private MeshFlat mMesh;
|
|
| 57 | 57 |
private DistortedEffects mEffects; |
| 58 | 58 |
private DistortedFramebuffer mScreen; |
| 59 | 59 |
|
| ... | ... | |
| 71 | 71 |
texWidth = BWID; |
| 72 | 72 |
texHeight= BHEI; |
| 73 | 73 |
|
| 74 |
mGrid = new GridFlat(80,80*texHeight/texWidth);
|
|
| 74 |
mMesh = new MeshFlat(80,80*texHeight/texWidth);
|
|
| 75 | 75 |
mTexture = new DistortedTexture(texWidth,texHeight); |
| 76 | 76 |
mEffects = new DistortedEffects(); |
| 77 | 77 |
|
| ... | ... | |
| 130 | 130 |
public void onDrawFrame(GL10 glUnused) |
| 131 | 131 |
{
|
| 132 | 132 |
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); |
| 133 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 133 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 134 | 134 |
} |
| 135 | 135 |
|
| 136 | 136 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/effects3d/Effects3DActivity.java | ||
|---|---|---|
| 38 | 38 |
|
| 39 | 39 |
import org.distorted.examples.R; |
| 40 | 40 |
import org.distorted.library.Distorted; |
| 41 |
import org.distorted.library.GridFlat;
|
|
| 42 |
import org.distorted.library.GridCubes;
|
|
| 43 |
import org.distorted.library.GridObject;
|
|
| 41 |
import org.distorted.library.MeshCubes;
|
|
| 42 |
import org.distorted.library.MeshFlat;
|
|
| 43 |
import org.distorted.library.MeshObject;
|
|
| 44 | 44 |
import org.distorted.library.DistortedTexture; |
| 45 | 45 |
import org.distorted.library.DistortedEffects; |
| 46 | 46 |
import org.distorted.library.EffectNames; |
| ... | ... | |
| 69 | 69 |
private boolean[] mShape; |
| 70 | 70 |
private DistortedTexture mTexture; |
| 71 | 71 |
private DistortedEffects mEffects; |
| 72 |
private GridObject mGrid;
|
|
| 72 |
private MeshObject mMesh;
|
|
| 73 | 73 |
private int mObjectType; |
| 74 | 74 |
private int mBitmapID; |
| 75 | 75 |
private Bitmap mBitmap; |
| ... | ... | |
| 233 | 233 |
|
| 234 | 234 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 235 | 235 |
|
| 236 |
public GridObject getGrid()
|
|
| 236 |
public MeshObject getGrid()
|
|
| 237 | 237 |
{
|
| 238 |
return mGrid;
|
|
| 238 |
return mMesh;
|
|
| 239 | 239 |
} |
| 240 | 240 |
|
| 241 | 241 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 412 | 412 |
|
| 413 | 413 |
mEffects = new DistortedEffects(); |
| 414 | 414 |
mTexture= new DistortedTexture(w,h); |
| 415 |
mGrid = new GridFlat(mNumCols,mNumCols*h/w);
|
|
| 415 |
mMesh = new MeshFlat(mNumCols,mNumCols*h/w);
|
|
| 416 | 416 |
setEffectView(); |
| 417 | 417 |
} |
| 418 | 418 |
else |
| ... | ... | |
| 443 | 443 |
|
| 444 | 444 |
mEffects = new DistortedEffects(); |
| 445 | 445 |
mTexture= new DistortedTexture(mNumCols,mNumRows); |
| 446 |
mGrid = new GridCubes(mNumCols, str, false);
|
|
| 446 |
mMesh = new MeshCubes(mNumCols, str, false);
|
|
| 447 | 447 |
|
| 448 | 448 |
setEffectView(); |
| 449 | 449 |
} |
| ... | ... | |
| 496 | 496 |
|
| 497 | 497 |
public int getDepth() |
| 498 | 498 |
{
|
| 499 |
return mTexture==null ? 0: mTexture.getDepth(mGrid);
|
|
| 499 |
return mTexture==null ? 0: mTexture.getDepth(mMesh);
|
|
| 500 | 500 |
} |
| 501 | 501 |
|
| 502 | 502 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java | ||
|---|---|---|
| 29 | 29 |
import org.distorted.library.DistortedEffects; |
| 30 | 30 |
import org.distorted.library.DistortedFramebuffer; |
| 31 | 31 |
import org.distorted.library.DistortedTexture; |
| 32 |
import org.distorted.library.GridFlat;
|
|
| 33 |
import org.distorted.library.GridObject;
|
|
| 32 |
import org.distorted.library.MeshFlat;
|
|
| 33 |
import org.distorted.library.MeshObject;
|
|
| 34 | 34 |
import org.distorted.library.EffectTypes; |
| 35 | 35 |
import org.distorted.library.type.Dynamic3D; |
| 36 | 36 |
import org.distorted.library.type.DynamicQuat; |
| ... | ... | |
| 51 | 51 |
private DistortedTexture mObjectTexture, mBackgroundTexture, mCenterTexture, mRegionTexture; |
| 52 | 52 |
private DistortedEffects mObjectEffects, mBackgroundEffects, mCenterEffects, mRegionEffects; |
| 53 | 53 |
private DistortedFramebuffer mScreen; |
| 54 |
private GridFlat mQuad;
|
|
| 55 |
private GridObject mObjectGrid;
|
|
| 54 |
private MeshFlat mQuad;
|
|
| 55 |
private MeshObject mObjectMesh;
|
|
| 56 | 56 |
private int mObjWidth, mObjHeight, mObjDepth; |
| 57 | 57 |
private DynamicQuat mQuatInt1, mQuatInt2; |
| 58 | 58 |
|
| ... | ... | |
| 75 | 75 |
Effects3DActivity act = (Effects3DActivity)v.getContext(); |
| 76 | 76 |
|
| 77 | 77 |
mObjectTexture = act.getTexture(); |
| 78 |
mObjectGrid = act.getGrid();
|
|
| 78 |
mObjectMesh = act.getGrid();
|
|
| 79 | 79 |
mObjectEffects = act.getEffects(); |
| 80 | 80 |
mBackgroundTexture = new DistortedTexture(100,100); |
| 81 | 81 |
mCenterTexture = new DistortedTexture(100,100); |
| 82 | 82 |
mRegionTexture = new DistortedTexture(100,100); |
| 83 |
mQuad = new GridFlat(1,1);
|
|
| 83 |
mQuad = new MeshFlat(1,1);
|
|
| 84 | 84 |
mBackgroundEffects = new DistortedEffects(); |
| 85 | 85 |
mCenterEffects = new DistortedEffects(); |
| 86 | 86 |
mRegionEffects = new DistortedEffects(); |
| 87 | 87 |
|
| 88 | 88 |
mObjWidth = mObjectTexture.getWidth(); |
| 89 | 89 |
mObjHeight= mObjectTexture.getHeight(); |
| 90 |
mObjDepth = mObjectTexture.getDepth(mObjectGrid);
|
|
| 90 |
mObjDepth = mObjectTexture.getDepth(mObjectMesh);
|
|
| 91 | 91 |
|
| 92 | 92 |
mQuat1 = new Static4D(0,0,0,1); // unity |
| 93 | 93 |
mQuat2 = new Static4D(0,0,0,1); // quaternions |
| ... | ... | |
| 138 | 138 |
long time = System.currentTimeMillis(); |
| 139 | 139 |
|
| 140 | 140 |
mScreen.renderTo(mBackgroundTexture,mQuad ,mBackgroundEffects,time); |
| 141 |
mScreen.renderTo(mObjectTexture ,mObjectGrid,mObjectEffects ,time);
|
|
| 141 |
mScreen.renderTo(mObjectTexture , mObjectMesh,mObjectEffects ,time);
|
|
| 142 | 142 |
|
| 143 | 143 |
if( Effects3DActivity.supportsCenter() ) |
| 144 | 144 |
{
|
| src/main/java/org/distorted/examples/fbo/FBORenderer.java | ||
|---|---|---|
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 | 32 |
import org.distorted.library.DistortedTree; |
| 33 | 33 |
import org.distorted.library.Distorted; |
| 34 |
import org.distorted.library.GridCubes;
|
|
| 35 |
import org.distorted.library.GridFlat;
|
|
| 34 |
import org.distorted.library.MeshCubes;
|
|
| 35 |
import org.distorted.library.MeshFlat;
|
|
| 36 | 36 |
import org.distorted.library.DistortedTexture; |
| 37 | 37 |
import org.distorted.library.EffectTypes; |
| 38 | 38 |
import org.distorted.library.type.Dynamic; |
| ... | ... | |
| 137 | 137 |
|
| 138 | 138 |
mEffects.abortAllEffects(); |
| 139 | 139 |
|
| 140 |
mRoot = new DistortedTree(lisa, mEffects,new GridFlat(1,1));
|
|
| 141 |
mRoot.attach(text,textEffects,new GridCubes(20,5,false));
|
|
| 140 |
mRoot = new DistortedTree(lisa, mEffects,new MeshFlat(1,1));
|
|
| 141 |
mRoot.attach(text,textEffects,new MeshCubes(20,5,false));
|
|
| 142 | 142 |
|
| 143 | 143 |
float factor = lisaWidth/(2.0f*textWidth); |
| 144 | 144 |
|
| src/main/java/org/distorted/examples/flag/FlagRenderer.java | ||
|---|---|---|
| 28 | 28 |
import org.distorted.library.Distorted; |
| 29 | 29 |
import org.distorted.library.DistortedEffects; |
| 30 | 30 |
import org.distorted.library.DistortedFramebuffer; |
| 31 |
import org.distorted.library.GridCubes;
|
|
| 31 |
import org.distorted.library.MeshCubes;
|
|
| 32 | 32 |
import org.distorted.library.DistortedTexture; |
| 33 | 33 |
import org.distorted.library.EffectTypes; |
| 34 | 34 |
import org.distorted.library.type.Dynamic; |
| ... | ... | |
| 52 | 52 |
private DistortedEffects mEffects; |
| 53 | 53 |
private DistortedTexture mTexture; |
| 54 | 54 |
private DistortedFramebuffer mScreen; |
| 55 |
private GridCubes mGrid;
|
|
| 55 |
private MeshCubes mMesh;
|
|
| 56 | 56 |
private DynamicQuat mQuatInt1, mQuatInt2; |
| 57 | 57 |
private Dynamic5D mWaveDyn; |
| 58 | 58 |
private Static5D mWaveSta1, mWaveSta2; |
| ... | ... | |
| 68 | 68 |
mView = v; |
| 69 | 69 |
|
| 70 | 70 |
mEffects = new DistortedEffects(); |
| 71 |
mGrid = new GridCubes(50,30,false);
|
|
| 71 |
mMesh = new MeshCubes(50,30,false);
|
|
| 72 | 72 |
mTexture = new DistortedTexture(500,300); |
| 73 | 73 |
|
| 74 | 74 |
mObjWidth = mTexture.getWidth(); |
| ... | ... | |
| 143 | 143 |
public void onDrawFrame(GL10 glUnused) |
| 144 | 144 |
{
|
| 145 | 145 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 146 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 146 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 147 | 147 |
} |
| 148 | 148 |
|
| 149 | 149 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/girl/GirlRenderer.java | ||
|---|---|---|
| 29 | 29 |
|
| 30 | 30 |
import org.distorted.library.Distorted; |
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 |
import org.distorted.library.GridFlat;
|
|
| 32 |
import org.distorted.library.MeshFlat;
|
|
| 33 | 33 |
import org.distorted.library.DistortedTexture; |
| 34 | 34 |
import org.distorted.library.DistortedEffects; |
| 35 | 35 |
import org.distorted.library.EffectTypes; |
| ... | ... | |
| 52 | 52 |
private DistortedTexture mTexture; |
| 53 | 53 |
private DistortedEffects mEffects; |
| 54 | 54 |
private DistortedFramebuffer mScreen; |
| 55 |
private GridFlat mGrid;
|
|
| 55 |
private MeshFlat mMesh;
|
|
| 56 | 56 |
private Static3D v0,v1,v2,v3; |
| 57 | 57 |
private Static1D dBegin, dMiddle, dEnd, s0; |
| 58 | 58 |
private int bmpHeight, bmpWidth; |
| ... | ... | |
| 154 | 154 |
public void onDrawFrame(GL10 glUnused) |
| 155 | 155 |
{
|
| 156 | 156 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 157 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 157 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 158 | 158 |
} |
| 159 | 159 |
|
| 160 | 160 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 208 | 208 |
bmpHeight = bitmap.getHeight(); |
| 209 | 209 |
bmpWidth = bitmap.getWidth(); |
| 210 | 210 |
|
| 211 |
mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
|
|
| 211 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
| 212 | 212 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 213 | 213 |
mTexture.setTexture(bitmap); |
| 214 | 214 |
|
| src/main/java/org/distorted/examples/listener/ListenerRenderer.java | ||
|---|---|---|
| 30 | 30 |
|
| 31 | 31 |
import org.distorted.library.Distorted; |
| 32 | 32 |
import org.distorted.library.DistortedFramebuffer; |
| 33 |
import org.distorted.library.GridFlat;
|
|
| 33 |
import org.distorted.library.MeshFlat;
|
|
| 34 | 34 |
import org.distorted.library.DistortedTexture; |
| 35 | 35 |
import org.distorted.library.DistortedEffects; |
| 36 | 36 |
import org.distorted.library.EffectNames; |
| ... | ... | |
| 56 | 56 |
private DistortedTexture mTexture; |
| 57 | 57 |
private DistortedEffects mEffects; |
| 58 | 58 |
private DistortedFramebuffer mScreen; |
| 59 |
private GridFlat mGrid;
|
|
| 59 |
private MeshFlat mMesh;
|
|
| 60 | 60 |
private int bmpHeight, bmpWidth; |
| 61 | 61 |
private Random mRnd; |
| 62 | 62 |
|
| ... | ... | |
| 106 | 106 |
public void onDrawFrame(GL10 glUnused) |
| 107 | 107 |
{
|
| 108 | 108 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 109 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 109 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 110 | 110 |
} |
| 111 | 111 |
|
| 112 | 112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 160 | 160 |
bmpHeight = bitmap.getHeight(); |
| 161 | 161 |
bmpWidth = bitmap.getWidth(); |
| 162 | 162 |
|
| 163 |
mGrid = new GridFlat(50,50*bmpHeight/bmpWidth);
|
|
| 163 |
mMesh = new MeshFlat(50,50*bmpHeight/bmpWidth);
|
|
| 164 | 164 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 165 | 165 |
mTexture.setTexture(bitmap); |
| 166 | 166 |
|
| src/main/java/org/distorted/examples/matrix3d/Matrix3DActivity.java | ||
|---|---|---|
| 33 | 33 |
import org.distorted.examples.R; |
| 34 | 34 |
import org.distorted.library.Distorted; |
| 35 | 35 |
import org.distorted.library.DistortedEffects; |
| 36 |
import org.distorted.library.GridObject;
|
|
| 37 |
import org.distorted.library.GridCubes;
|
|
| 36 |
import org.distorted.library.MeshCubes;
|
|
| 37 |
import org.distorted.library.MeshObject;
|
|
| 38 | 38 |
import org.distorted.library.DistortedTexture; |
| 39 | 39 |
import org.distorted.library.EffectNames; |
| 40 | 40 |
import org.distorted.library.EffectTypes; |
| ... | ... | |
| 48 | 48 |
public class Matrix3DActivity extends Activity implements AdapterView.OnItemSelectedListener |
| 49 | 49 |
{
|
| 50 | 50 |
private DistortedTexture mTexture; |
| 51 |
private GridObject mGrid;
|
|
| 51 |
private MeshObject mMesh;
|
|
| 52 | 52 |
private DistortedEffects mEffects; |
| 53 | 53 |
|
| 54 | 54 |
private ArrayList<Matrix3DEffect> mList; |
| ... | ... | |
| 70 | 70 |
createEffectNames(); |
| 71 | 71 |
|
| 72 | 72 |
mEffects = new DistortedEffects(); |
| 73 |
mGrid = new GridCubes(1,1,false);
|
|
| 73 |
mMesh = new MeshCubes(1,1,false);
|
|
| 74 | 74 |
mTexture= new DistortedTexture(100,100); |
| 75 | 75 |
|
| 76 | 76 |
setEffectView(); |
| ... | ... | |
| 116 | 116 |
|
| 117 | 117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 118 | 118 |
|
| 119 |
public GridObject getGrid()
|
|
| 119 |
public MeshObject getGrid()
|
|
| 120 | 120 |
{
|
| 121 |
return mGrid;
|
|
| 121 |
return mMesh;
|
|
| 122 | 122 |
} |
| 123 | 123 |
|
| 124 | 124 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 191 | 191 |
|
| 192 | 192 |
public int getDepth() |
| 193 | 193 |
{
|
| 194 |
return mTexture==null ? 0: mTexture.getDepth(mGrid);
|
|
| 194 |
return mTexture==null ? 0: mTexture.getDepth(mMesh);
|
|
| 195 | 195 |
} |
| 196 | 196 |
|
| 197 | 197 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/matrix3d/Matrix3DRenderer.java | ||
|---|---|---|
| 25 | 25 |
import org.distorted.library.Distorted; |
| 26 | 26 |
import org.distorted.library.DistortedEffects; |
| 27 | 27 |
import org.distorted.library.DistortedFramebuffer; |
| 28 |
import org.distorted.library.GridObject;
|
|
| 28 |
import org.distorted.library.MeshObject;
|
|
| 29 | 29 |
import org.distorted.library.DistortedTexture; |
| 30 | 30 |
|
| 31 | 31 |
import javax.microedition.khronos.egl.EGLConfig; |
| ... | ... | |
| 39 | 39 |
private DistortedTexture mTexture; |
| 40 | 40 |
private DistortedEffects mEffects; |
| 41 | 41 |
private DistortedFramebuffer mScreen; |
| 42 |
private GridObject mGrid;
|
|
| 42 |
private MeshObject mMesh;
|
|
| 43 | 43 |
|
| 44 | 44 |
private int mWidth, mHeight; |
| 45 | 45 |
|
| ... | ... | |
| 53 | 53 |
|
| 54 | 54 |
mEffects= act.getEffects(); |
| 55 | 55 |
mTexture= act.getTexture(); |
| 56 |
mGrid = act.getGrid();
|
|
| 56 |
mMesh = act.getGrid();
|
|
| 57 | 57 |
mScreen = new DistortedFramebuffer(0); |
| 58 | 58 |
} |
| 59 | 59 |
|
| ... | ... | |
| 62 | 62 |
public void onDrawFrame(GL10 glUnused) |
| 63 | 63 |
{
|
| 64 | 64 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 65 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 65 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 66 | 66 |
} |
| 67 | 67 |
|
| 68 | 68 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/mirror/MirrorRenderer.java | ||
|---|---|---|
| 29 | 29 |
import org.distorted.library.DistortedEffects; |
| 30 | 30 |
import org.distorted.library.DistortedFramebuffer; |
| 31 | 31 |
import org.distorted.library.DistortedTexture; |
| 32 |
import org.distorted.library.GridFlat;
|
|
| 32 |
import org.distorted.library.MeshFlat;
|
|
| 33 | 33 |
import org.distorted.library.type.Dynamic3D; |
| 34 | 34 |
import org.distorted.library.type.Static1D; |
| 35 | 35 |
import org.distorted.library.type.Static3D; |
| ... | ... | |
| 56 | 56 |
private DistortedEffects mEffectsOffscreen1, mEffectsOffscreen2; |
| 57 | 57 |
private DistortedTexture mTextureMirror, mTextureHead; |
| 58 | 58 |
private DistortedFramebuffer mScreen, mOffScreen1, mOffScreen2; |
| 59 |
private GridFlat mQuad;
|
|
| 59 |
private MeshFlat mQuad;
|
|
| 60 | 60 |
private Static3D mHeadPosition; |
| 61 | 61 |
private Dynamic3D mHeadDyn; |
| 62 | 62 |
private int mX; |
| ... | ... | |
| 69 | 69 |
MirrorRenderer(GLSurfaceView view) |
| 70 | 70 |
{
|
| 71 | 71 |
mView = view; |
| 72 |
mQuad = new GridFlat(1,1);
|
|
| 72 |
mQuad = new MeshFlat(1,1);
|
|
| 73 | 73 |
mScreen = new DistortedFramebuffer(0); |
| 74 | 74 |
|
| 75 | 75 |
mEffectsMirror = new DistortedEffects(); |
| src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java | ||
|---|---|---|
| 30 | 30 |
import org.distorted.library.DistortedEffects; |
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 | 32 |
import org.distorted.library.DistortedTexture; |
| 33 |
import org.distorted.library.GridFlat;
|
|
| 33 |
import org.distorted.library.MeshFlat;
|
|
| 34 | 34 |
import org.distorted.library.EffectTypes; |
| 35 | 35 |
import org.distorted.library.type.Dynamic3D; |
| 36 | 36 |
import org.distorted.library.type.Static3D; |
| ... | ... | |
| 49 | 49 |
private DistortedTexture mTexture; |
| 50 | 50 |
private DistortedEffects mEffects; |
| 51 | 51 |
private DistortedFramebuffer mScreen; |
| 52 |
private GridFlat mGrid;
|
|
| 52 |
private MeshFlat mMesh;
|
|
| 53 | 53 |
private int bmpHeight, bmpWidth; |
| 54 | 54 |
|
| 55 | 55 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 82 | 82 |
public void onDrawFrame(GL10 glUnused) |
| 83 | 83 |
{
|
| 84 | 84 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 85 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 85 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 86 | 86 |
} |
| 87 | 87 |
|
| 88 | 88 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 134 | 134 |
bmpHeight = bitmap.getHeight(); |
| 135 | 135 |
bmpWidth = bitmap.getWidth(); |
| 136 | 136 |
|
| 137 |
mGrid = new GridFlat(9,9*bmpHeight/bmpWidth);
|
|
| 137 |
mMesh = new MeshFlat(9,9*bmpHeight/bmpWidth);
|
|
| 138 | 138 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 139 | 139 |
mTexture.setTexture(bitmap); |
| 140 | 140 |
|
| src/main/java/org/distorted/examples/movingeffects/MovingEffectsRenderer.java | ||
|---|---|---|
| 32 | 32 |
import org.distorted.library.DistortedFramebuffer; |
| 33 | 33 |
import org.distorted.library.DistortedTexture; |
| 34 | 34 |
import org.distorted.library.DistortedEffects; |
| 35 |
import org.distorted.library.GridFlat;
|
|
| 35 |
import org.distorted.library.MeshFlat;
|
|
| 36 | 36 |
import org.distorted.library.Distorted; |
| 37 | 37 |
|
| 38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 45 | 45 |
private Paint mPaint; |
| 46 | 46 |
private int texW, texH; |
| 47 | 47 |
|
| 48 |
private GridFlat mGrid;
|
|
| 48 |
private MeshFlat mMesh;
|
|
| 49 | 49 |
private DistortedEffects mEffects; |
| 50 | 50 |
private DistortedTexture mTexture; |
| 51 | 51 |
private DistortedFramebuffer mScreen; |
| ... | ... | |
| 126 | 126 |
texW = width; |
| 127 | 127 |
texH = height; |
| 128 | 128 |
|
| 129 |
mGrid = new GridFlat(80,80*texH/texW);
|
|
| 129 |
mMesh = new MeshFlat(80,80*texH/texW);
|
|
| 130 | 130 |
mTexture = new DistortedTexture(texW,texH); |
| 131 | 131 |
mBitmap = Bitmap.createBitmap(texW,texH, Bitmap.Config.ARGB_8888); |
| 132 | 132 |
mCanvas = new Canvas(mBitmap); |
| ... | ... | |
| 153 | 153 |
mRefresh = false; |
| 154 | 154 |
} |
| 155 | 155 |
|
| 156 |
mScreen.renderTo(mTexture, mGrid, mEffects, time );
|
|
| 156 |
mScreen.renderTo(mTexture, mMesh, mEffects, time );
|
|
| 157 | 157 |
} |
| 158 | 158 |
|
| 159 | 159 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java | ||
|---|---|---|
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 | 32 |
import org.distorted.library.DistortedTree; |
| 33 | 33 |
import org.distorted.library.EffectTypes; |
| 34 |
import org.distorted.library.MeshFlat; |
|
| 34 | 35 |
import org.distorted.library.type.Dynamic1D; |
| 35 | 36 |
import org.distorted.library.type.Static3D; |
| 36 | 37 |
import org.distorted.library.type.Static1D; |
| 37 | 38 |
import org.distorted.library.Distorted; |
| 38 |
import org.distorted.library.GridFlat; |
|
| 39 | 39 |
import org.distorted.library.DistortedTexture; |
| 40 | 40 |
|
| 41 | 41 |
import android.graphics.Bitmap; |
| ... | ... | |
| 64 | 64 |
mView = v; |
| 65 | 65 |
|
| 66 | 66 |
mLeaf = new DistortedTexture(LEAF_SIZE,LEAF_SIZE); |
| 67 |
GridFlat grid = new GridFlat(1,1);
|
|
| 67 |
MeshFlat mesh = new MeshFlat(1,1);
|
|
| 68 | 68 |
DistortedEffects effects = new DistortedEffects(); |
| 69 | 69 |
|
| 70 | 70 |
mScreenW = 9*LEAF_SIZE; |
| 71 | 71 |
mScreenH = 9*LEAF_SIZE; |
| 72 |
mRoot = new DistortedTree(new DistortedTexture(mScreenW,mScreenH), effects, grid);
|
|
| 72 |
mRoot = new DistortedTree(new DistortedTexture(mScreenW,mScreenH), effects, mesh);
|
|
| 73 | 73 |
|
| 74 | 74 |
Dynamic1D rot = new Dynamic1D(5000,0.0f); |
| 75 | 75 |
rot.setMode(Dynamic1D.MODE_JUMP); |
| ... | ... | |
| 90 | 90 |
if( i<=1 ) |
| 91 | 91 |
{
|
| 92 | 92 |
effects = new DistortedEffects(); |
| 93 |
mCircleNode[i] = new DistortedTree(new DistortedTexture(3*LEAF_SIZE,3*LEAF_SIZE), effects, grid);
|
|
| 93 |
mCircleNode[i] = new DistortedTree(new DistortedTexture(3*LEAF_SIZE,3*LEAF_SIZE), effects, mesh);
|
|
| 94 | 94 |
|
| 95 | 95 |
for(int j=0; j<NUM_LEAVES-i; j++) |
| 96 | 96 |
{
|
| 97 | 97 |
effects = new DistortedEffects(); |
| 98 |
mCircleNode[i].attach(mLeaf, effects, grid);
|
|
| 98 |
mCircleNode[i].attach(mLeaf, effects, mesh);
|
|
| 99 | 99 |
effects.rotate( new Static1D(j*(360/NUM_LEAVES)), axis, center ); |
| 100 | 100 |
effects.move(moveVector); |
| 101 | 101 |
} |
| src/main/java/org/distorted/examples/plainmonalisa/RenderThread.java | ||
|---|---|---|
| 33 | 33 |
import org.distorted.library.Distorted; |
| 34 | 34 |
import org.distorted.library.DistortedEffects; |
| 35 | 35 |
import org.distorted.library.DistortedFramebuffer; |
| 36 |
import org.distorted.library.GridFlat;
|
|
| 36 |
import org.distorted.library.MeshFlat;
|
|
| 37 | 37 |
import org.distorted.library.DistortedTexture; |
| 38 | 38 |
import org.distorted.library.EffectTypes; |
| 39 | 39 |
import org.distorted.library.type.Dynamic3D; |
| ... | ... | |
| 65 | 65 |
private DistortedTexture mTexture; |
| 66 | 66 |
private DistortedEffects mEffects; |
| 67 | 67 |
private DistortedFramebuffer mScreen; |
| 68 |
private GridFlat mGrid;
|
|
| 68 |
private MeshFlat mMesh;
|
|
| 69 | 69 |
private int bmpHeight, bmpWidth; |
| 70 | 70 |
private SurfaceView mView; |
| 71 | 71 |
|
| ... | ... | |
| 214 | 214 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 215 | 215 |
mTexture.setTexture(bmp); |
| 216 | 216 |
|
| 217 |
mGrid= new GridFlat(9,9*bmpHeight/bmpWidth); // more-or-less square Grid with 9 columns.
|
|
| 217 |
mMesh = new MeshFlat(9,9*bmpHeight/bmpWidth); // more-or-less square Grid with 9 columns.
|
|
| 218 | 218 |
|
| 219 | 219 |
try |
| 220 | 220 |
{
|
| ... | ... | |
| 267 | 267 |
eglCore.makeCurrent(eglSurface); |
| 268 | 268 |
|
| 269 | 269 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 270 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 270 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 271 | 271 |
|
| 272 | 272 |
eglCore.swapBuffers(eglSurface); |
| 273 | 273 |
} |
| src/main/java/org/distorted/examples/projection/ProjectionRenderer.java | ||
|---|---|---|
| 25 | 25 |
import org.distorted.library.Distorted; |
| 26 | 26 |
import org.distorted.library.DistortedEffects; |
| 27 | 27 |
import org.distorted.library.DistortedFramebuffer; |
| 28 |
import org.distorted.library.GridFlat;
|
|
| 28 |
import org.distorted.library.MeshFlat;
|
|
| 29 | 29 |
import org.distorted.library.DistortedTexture; |
| 30 | 30 |
import org.distorted.library.type.Static3D; |
| 31 | 31 |
import org.distorted.library.type.Static4D; |
| ... | ... | |
| 45 | 45 |
private DistortedTexture mTexture; |
| 46 | 46 |
private DistortedEffects mEffects; |
| 47 | 47 |
private DistortedFramebuffer mScreen; |
| 48 |
private GridFlat mGrid;
|
|
| 48 |
private MeshFlat mMesh;
|
|
| 49 | 49 |
|
| 50 | 50 |
private float mF, mX, mY; |
| 51 | 51 |
private int mWidth, mHeight; |
| ... | ... | |
| 91 | 91 |
public void onDrawFrame(GL10 glUnused) |
| 92 | 92 |
{
|
| 93 | 93 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 94 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 94 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 95 | 95 |
} |
| 96 | 96 |
|
| 97 | 97 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 106 | 106 |
|
| 107 | 107 |
Paint paint = new Paint(); |
| 108 | 108 |
mTexture = new DistortedTexture(width,height); |
| 109 |
mGrid = new GridFlat(50,50*height/width);
|
|
| 109 |
mMesh = new MeshFlat(50,50*height/width);
|
|
| 110 | 110 |
Bitmap bmp = Bitmap.createBitmap(width,height, Bitmap.Config.ARGB_8888); |
| 111 | 111 |
Canvas bmpCanvas = new Canvas(bmp); |
| 112 | 112 |
|
| src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java | ||
|---|---|---|
| 33 | 33 |
import org.distorted.library.EffectTypes; |
| 34 | 34 |
import org.distorted.library.type.Dynamic; |
| 35 | 35 |
import org.distorted.library.type.DynamicQuat; |
| 36 |
import org.distorted.library.GridCubes;
|
|
| 36 |
import org.distorted.library.MeshCubes;
|
|
| 37 | 37 |
import org.distorted.library.DistortedTexture; |
| 38 | 38 |
import org.distorted.library.type.Static4D; |
| 39 | 39 |
import org.distorted.library.type.Static3D; |
| ... | ... | |
| 54 | 54 |
private DistortedTexture mTexture; |
| 55 | 55 |
private DistortedEffects mEffects; |
| 56 | 56 |
private DistortedFramebuffer mScreen; |
| 57 |
private GridCubes mGrid;
|
|
| 57 |
private MeshCubes mMesh;
|
|
| 58 | 58 |
private DynamicQuat mRot; |
| 59 | 59 |
|
| 60 | 60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 62 | 62 |
QuaternionRenderer(GLSurfaceView v) |
| 63 | 63 |
{
|
| 64 | 64 |
mView = v; |
| 65 |
mGrid = new GridCubes(1,1,false);
|
|
| 65 |
mMesh = new MeshCubes(1,1,false);
|
|
| 66 | 66 |
mTexture = new DistortedTexture(1,1); |
| 67 | 67 |
mEffects = new DistortedEffects(); |
| 68 | 68 |
mRot = new DynamicQuat(); |
| ... | ... | |
| 94 | 94 |
public void onDrawFrame(GL10 glUnused) |
| 95 | 95 |
{
|
| 96 | 96 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 97 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 97 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 98 | 98 |
} |
| 99 | 99 |
|
| 100 | 100 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/save/SaveRenderer.java | ||
|---|---|---|
| 33 | 33 |
import org.distorted.library.Distorted; |
| 34 | 34 |
import org.distorted.library.DistortedEffects; |
| 35 | 35 |
import org.distorted.library.DistortedTexture; |
| 36 |
import org.distorted.library.GridFlat;
|
|
| 36 |
import org.distorted.library.MeshFlat;
|
|
| 37 | 37 |
import org.distorted.library.DistortedFramebuffer; |
| 38 | 38 |
import org.distorted.library.EffectTypes; |
| 39 | 39 |
import org.distorted.library.type.Dynamic1D; |
| ... | ... | |
| 55 | 55 |
private GLSurfaceView mView; |
| 56 | 56 |
private DistortedTexture mTexture; |
| 57 | 57 |
private DistortedEffects mEffects; |
| 58 |
private GridFlat mGrid;
|
|
| 58 |
private MeshFlat mMesh;
|
|
| 59 | 59 |
private DistortedFramebuffer mScreen, mOffscreen; |
| 60 | 60 |
private Static1D s0; |
| 61 | 61 |
private Dynamic3D mScaleDyn; |
| ... | ... | |
| 156 | 156 |
{
|
| 157 | 157 |
mEffects.abortEffects(EffectTypes.MATRIX); |
| 158 | 158 |
mEffects.scale(mScaleFactor); |
| 159 |
mOffscreen.renderTo(mTexture, mGrid, mEffects, time );
|
|
| 159 |
mOffscreen.renderTo(mTexture, mMesh, mEffects, time );
|
|
| 160 | 160 |
applyMatrixEffects(scrWidth,scrHeight); |
| 161 | 161 |
|
| 162 | 162 |
int fW =(int)(mScale*bmpWidth); |
| ... | ... | |
| 180 | 180 |
isSaving = false; |
| 181 | 181 |
} |
| 182 | 182 |
|
| 183 |
mScreen.renderTo(mTexture, mGrid, mEffects, time );
|
|
| 183 |
mScreen.renderTo(mTexture, mMesh, mEffects, time );
|
|
| 184 | 184 |
} |
| 185 | 185 |
|
| 186 | 186 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 244 | 244 |
bmpHeight = bitmap.getHeight(); |
| 245 | 245 |
bmpWidth = bitmap.getWidth(); |
| 246 | 246 |
|
| 247 |
mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
|
|
| 247 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
| 248 | 248 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 249 | 249 |
mTexture.setTexture(bitmap); |
| 250 | 250 |
|
| src/main/java/org/distorted/examples/sink/SinkRenderer.java | ||
|---|---|---|
| 30 | 30 |
import org.distorted.library.Distorted; |
| 31 | 31 |
import org.distorted.library.DistortedEffects; |
| 32 | 32 |
import org.distorted.library.DistortedFramebuffer; |
| 33 |
import org.distorted.library.GridFlat;
|
|
| 33 |
import org.distorted.library.MeshFlat;
|
|
| 34 | 34 |
import org.distorted.library.DistortedTexture; |
| 35 | 35 |
import org.distorted.library.EffectTypes; |
| 36 | 36 |
import org.distorted.library.type.Dynamic1D; |
| ... | ... | |
| 50 | 50 |
private DistortedTexture mTexture; |
| 51 | 51 |
private DistortedEffects mEffects; |
| 52 | 52 |
private DistortedFramebuffer mScreen; |
| 53 |
private GridFlat mGrid;
|
|
| 53 |
private MeshFlat mMesh;
|
|
| 54 | 54 |
private int bmpHeight, bmpWidth; |
| 55 | 55 |
|
| 56 | 56 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 74 | 74 |
public void onDrawFrame(GL10 glUnused) |
| 75 | 75 |
{
|
| 76 | 76 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 77 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 77 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 78 | 78 |
} |
| 79 | 79 |
|
| 80 | 80 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 128 | 128 |
bmpHeight = bitmap.getHeight(); |
| 129 | 129 |
bmpWidth = bitmap.getWidth(); |
| 130 | 130 |
|
| 131 |
mGrid = new GridFlat(30,30*bmpHeight/bmpWidth);
|
|
| 131 |
mMesh = new MeshFlat(30,30*bmpHeight/bmpWidth);
|
|
| 132 | 132 |
mTexture = new DistortedTexture(bmpWidth,bmpHeight); |
| 133 | 133 |
mTexture.setTexture(bitmap); |
| 134 | 134 |
|
| src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java | ||
|---|---|---|
| 29 | 29 |
import org.distorted.examples.R; |
| 30 | 30 |
|
| 31 | 31 |
import org.distorted.library.DistortedFramebuffer; |
| 32 |
import org.distorted.library.GridFlat;
|
|
| 32 |
import org.distorted.library.MeshFlat;
|
|
| 33 | 33 |
import org.distorted.library.EffectNames; |
| 34 | 34 |
import org.distorted.library.type.Dynamic1D; |
| 35 | 35 |
import org.distorted.library.type.Dynamic3D; |
| ... | ... | |
| 108 | 108 |
private DistortedEffects[] mStarEffects; |
| 109 | 109 |
private DistortedTree mRoot, mBackground; |
| 110 | 110 |
private DistortedFramebuffer mScreen; |
| 111 |
private GridFlat mQuad;
|
|
| 111 |
private MeshFlat mQuad;
|
|
| 112 | 112 |
|
| 113 | 113 |
private long gffaID, logoID, crawlID; |
| 114 | 114 |
private Random mRnd = new Random(0); |
| ... | ... | |
| 120 | 120 |
{
|
| 121 | 121 |
mView = v; |
| 122 | 122 |
|
| 123 |
mQuad = new GridFlat(1,1);
|
|
| 123 |
mQuad = new MeshFlat(1,1);
|
|
| 124 | 124 |
|
| 125 | 125 |
mScreenEffects = new DistortedEffects(); |
| 126 | 126 |
mGFFAEffects = new DistortedEffects(); |
| src/main/java/org/distorted/examples/wind/WindRenderer.java | ||
|---|---|---|
| 27 | 27 |
import org.distorted.examples.R; |
| 28 | 28 |
import org.distorted.library.Distorted; |
| 29 | 29 |
import org.distorted.library.DistortedFramebuffer; |
| 30 |
import org.distorted.library.GridCubes;
|
|
| 30 |
import org.distorted.library.MeshCubes;
|
|
| 31 | 31 |
import org.distorted.library.DistortedEffects; |
| 32 | 32 |
import org.distorted.library.DistortedTexture; |
| 33 | 33 |
import org.distorted.library.type.Static1D; |
| ... | ... | |
| 47 | 47 |
private DistortedEffects mEffects; |
| 48 | 48 |
private DistortedTexture mTexture; |
| 49 | 49 |
private DistortedFramebuffer mScreen; |
| 50 |
private GridCubes mGrid;
|
|
| 50 |
private MeshCubes mMesh;
|
|
| 51 | 51 |
private WindEffectsManager mManager; |
| 52 | 52 |
private int mObjWidth, mObjHeight; |
| 53 | 53 |
private int mWind; |
| ... | ... | |
| 58 | 58 |
{
|
| 59 | 59 |
mView = view; |
| 60 | 60 |
|
| 61 |
mGrid = new GridCubes(50,30,false);
|
|
| 61 |
mMesh = new MeshCubes(50,30,false);
|
|
| 62 | 62 |
mEffects = new DistortedEffects(); |
| 63 | 63 |
mTexture = new DistortedTexture(50,30); |
| 64 | 64 |
mManager = new WindEffectsManager(mTexture); |
| ... | ... | |
| 81 | 81 |
public void onDrawFrame(GL10 glUnused) |
| 82 | 82 |
{
|
| 83 | 83 |
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); |
| 84 |
mScreen.renderTo(mTexture, mGrid, mEffects, System.currentTimeMillis() );
|
|
| 84 |
mScreen.renderTo(mTexture, mMesh, mEffects, System.currentTimeMillis() );
|
|
| 85 | 85 |
} |
| 86 | 86 |
|
| 87 | 87 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Rename Grid to Mesh