Revision 8744aa41
Added by Leszek Koltunski over 8 years ago
| src/main/java/org/distorted/examples/fbo/FBORenderer.java | ||
|---|---|---|
| 29 | 29 |  | 
| 30 | 30 | import org.distorted.library.DistortedEffects; | 
| 31 | 31 | import org.distorted.library.DistortedFramebuffer; | 
| 32 | import org.distorted.library.DistortedNode; | |
| 32 | 33 | import org.distorted.library.DistortedScreen; | 
| 33 | import org.distorted.library.DistortedTree; | |
| 34 | 34 | import org.distorted.library.Distorted; | 
| 35 | 35 | import org.distorted.library.MeshCubes; | 
| 36 | 36 | import org.distorted.library.MeshFlat; | 
| ... | ... | |
| 53 | 53 | private GLSurfaceView mView; | 
| 54 | 54 | private DistortedEffects mEffects; | 
| 55 | 55 | private DistortedScreen mScreen; | 
| 56 |    private DistortedTree mRoot;
 | |
| 56 |    private DistortedNode mRoot;
 | |
| 57 | 57 | private int lisaHeight, lisaWidth; | 
| 58 | 58 |  | 
| 59 | 59 | /////////////////////////////////////////////////////////////////////////////////////////////////// | 
| ... | ... | |
| 149 | 149 |  | 
| 150 | 150 | mEffects.abortAllEffects(); | 
| 151 | 151 |  | 
| 152 |       mRoot = new DistortedTree(lisa, mEffects,new MeshFlat(1,1));
 | |
| 152 |       mRoot = new DistortedNode(lisa, mEffects,new MeshFlat(1,1));
 | |
| 153 | 153 | mRoot.attach(grid,gridEffects,new MeshCubes(10,10,false)); | 
| 154 | 154 |  | 
| 155 | 155 | float factor = lisaWidth/(2.0f*gridWidth); | 
| src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java | ||
|---|---|---|
| 29 | 29 |  | 
| 30 | 30 | import org.distorted.library.DistortedEffects; | 
| 31 | 31 | import org.distorted.library.DistortedScreen; | 
| 32 | import org.distorted.library.DistortedTree;
 | |
| 32 | import org.distorted.library.DistortedNode;
 | |
| 33 | 33 | import org.distorted.library.EffectTypes; | 
| 34 | 34 | import org.distorted.library.MeshFlat; | 
| 35 | 35 | import org.distorted.library.type.Dynamic1D; | 
| ... | ... | |
| 52 | 52 | private static final int NUM_LEAVES = 8; | 
| 53 | 53 |  | 
| 54 | 54 | private GLSurfaceView mView; | 
| 55 |    private DistortedTree mRoot;
 | |
| 55 |    private DistortedNode mRoot;
 | |
| 56 | 56 | private DistortedTexture mLeaf; | 
| 57 | 57 | private DistortedScreen mScreen; | 
| 58 | 58 | private int mScreenW, mScreenH; | 
| ... | ... | |
| 69 | 69 |  | 
| 70 | 70 | mScreenW = 9*LEAF_SIZE; | 
| 71 | 71 | mScreenH = 9*LEAF_SIZE; | 
| 72 |       mRoot = new DistortedTree(new DistortedTexture(mScreenW,mScreenH), effects, mesh);
 | |
| 72 |       mRoot = new DistortedNode(new DistortedTexture(mScreenW,mScreenH), effects, mesh);
 | |
| 73 | 73 |  | 
| 74 | 74 | Dynamic1D rot = new Dynamic1D(5000,0.0f); | 
| 75 | 75 | rot.setMode(Dynamic1D.MODE_JUMP); | 
| 76 | 76 | rot.add(new Static1D( 0)); | 
| 77 | 77 | rot.add(new Static1D(360)); | 
| 78 | 78 |  | 
| 79 |       DistortedTree[] mCircleNode = new DistortedTree[NUM_CIRCLES];
 | |
| 79 |       DistortedNode[] mCircleNode = new DistortedNode[NUM_CIRCLES];
 | |
| 80 | 80 |  | 
| 81 | 81 |       int[] colors    = new int[] {0,0,1,  0,0,0,  1,0,0,  1,1,0,  0,1,0}; // blue, black, red, yellow, green  
 | 
| 82 | 82 |       int[] positions = new int[] {0,2*LEAF_SIZE,  3*LEAF_SIZE,2*LEAF_SIZE,  6*LEAF_SIZE,2*LEAF_SIZE,  3*LEAF_SIZE/2,9*LEAF_SIZE/2,  9*LEAF_SIZE/2,9*LEAF_SIZE/2};
 | 
| ... | ... | |
| 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, mesh);
 | |
| 93 |           mCircleNode[i] = new DistortedNode(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 |             {
 | 
| ... | ... | |
| 102 | 102 | } | 
| 103 | 103 | else | 
| 104 | 104 |           {
 | 
| 105 |           mCircleNode[i] = new DistortedTree(mCircleNode[0], Distorted.CLONE_SURFACE |Distorted.CLONE_CHILDREN);
 | |
| 105 |           mCircleNode[i] = new DistortedNode(mCircleNode[0], Distorted.CLONE_SURFACE |Distorted.CLONE_CHILDREN);
 | |
| 106 | 106 | } | 
| 107 | 107 |  | 
| 108 | 108 | mRoot.attach(mCircleNode[i]); | 
| src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java | ||
|---|---|---|
| 28 | 28 |  | 
| 29 | 29 | import org.distorted.examples.R; | 
| 30 | 30 |  | 
| 31 | import org.distorted.library.DistortedFramebuffer;
 | |
| 31 | import org.distorted.library.DistortedNode;
 | |
| 32 | 32 | import org.distorted.library.DistortedScreen; | 
| 33 | 33 | import org.distorted.library.MeshFlat; | 
| 34 | 34 | import org.distorted.library.EffectNames; | 
| 35 | 35 | import org.distorted.library.type.Dynamic1D; | 
| 36 | 36 | import org.distorted.library.type.Dynamic3D; | 
| 37 | import org.distorted.library.DistortedTree; | |
| 38 | 37 | import org.distorted.library.type.Static1D; | 
| 39 | 38 | import org.distorted.library.type.Static3D; | 
| 40 | 39 | import org.distorted.library.type.Static4D; | 
| ... | ... | |
| 107 | 106 | private DistortedTexture mScreenTexture, mGFFATexture, mLogoTexture, mCrawlTexture, mCrawlBackgroundTexture, mStarTexture; | 
| 108 | 107 | private DistortedEffects mScreenEffects, mGFFAEffects, mLogoEffects, mCrawlEffects, mCrawlBackgroundEffects; | 
| 109 | 108 | private DistortedEffects[] mStarEffects; | 
| 110 |   private DistortedTree mRoot, mBackground;
 | |
| 109 |   private DistortedNode mRoot, mBackground;
 | |
| 111 | 110 | private DistortedScreen mScreen; | 
| 112 | 111 | private MeshFlat mQuad; | 
| 113 | 112 |  | 
| ... | ... | |
| 200 | 199 | private void setupScreen(int w, int h) | 
| 201 | 200 |     {
 | 
| 202 | 201 | mScreenTexture = new DistortedTexture(w,h); | 
| 203 |     mRoot = new DistortedTree(mScreenTexture, mScreenEffects,mQuad);
 | |
| 202 |     mRoot = new DistortedNode(mScreenTexture, mScreenEffects,mQuad);
 | |
| 204 | 203 |  | 
| 205 | 204 | mCrawlBackgroundTexture = new DistortedTexture(w,(int)(Math.sqrt(3.0)*h)); | 
| 206 | 205 |  | 
Also available in: Unified diff
Preparation for change of the render API.