Project

General

Profile

« Previous | Next » 

Revision c0486401

Added by Leszek Koltunski over 7 years ago

Improve the 'FBO' app to test more things.

View differences:

src/main/java/org/distorted/examples/fbo/FBORenderer.java
29 29

  
30 30
import org.distorted.library.DistortedObjectTree;
31 31
import org.distorted.library.Distorted;
32
import org.distorted.library.GridCubes;
32 33
import org.distorted.library.GridFlat;
33 34
import org.distorted.library.DistortedTexture;
34 35
import org.distorted.library.DistortedEffectQueues;
35 36
import org.distorted.library.EffectTypes;
37
import org.distorted.library.type.Dynamic;
36 38
import org.distorted.library.type.Dynamic1D;
37 39
import org.distorted.library.type.Static1D;
38 40
import org.distorted.library.type.Static3D;
......
101 103
      GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
102 104

  
103 105
      InputStream is1 = mView.getContext().getResources().openRawResource(R.raw.monalisa);
104
      InputStream is2 = mView.getContext().getResources().openRawResource(R.raw.fbo);
106
      InputStream is2 = mView.getContext().getResources().openRawResource(R.raw.grid);
105 107
      
106 108
      Bitmap bitmap1, bitmap2;
107 109
       
......
132 134
      DistortedEffectQueues textQueues = new DistortedEffectQueues();
133 135

  
134 136
      mRoot = new DistortedObjectTree(lisa,mQueues,new GridFlat(1,1));
135
      mRoot.attach(text,textQueues,new GridFlat(20,5));
137
      mRoot.attach(text,textQueues,new GridCubes(20,5,false));
136 138

  
137
      float factor = lisaWidth/(1.5f*textWidth);
139
      float factor = lisaWidth/(2.0f*textWidth);
138 140

  
139
      textQueues.move( new Static3D(lisaWidth/6,lisaHeight/3,0) );
141
      textQueues.move( new Static3D( (lisaWidth-factor*textWidth)/2,(lisaHeight-factor*textHeight)/2,0) );
140 142
      textQueues.scale(factor);
141 143

  
142
      Dynamic1D sinkDyn = new Dynamic1D(5000,0.0f);
144
      Dynamic1D rotDyn = new Dynamic1D(12000,0.0f);
145
      rotDyn.add(new Static1D(  0));
146
      rotDyn.add(new Static1D(360));
147
      rotDyn.setMode(Dynamic.MODE_JUMP);
148

  
149
      textQueues.rotate(rotDyn, new Static3D(1,0,0), new Static3D(textWidth/2,textHeight/2,textHeight/10) );
150

  
151
      Dynamic1D sinkDyn = new Dynamic1D(3000,0.0f);
143 152
      sinkDyn.add(new Static1D(1.0f));
144
      sinkDyn.add(new Static1D(0.5f));
153
      sinkDyn.add(new Static1D(0.3f));
145 154

  
146 155
      textQueues.sink(sinkDyn, new Static3D(textWidth/2,textHeight/2, 0));
147 156

  
148
      Dynamic1D chromaDyn = new Dynamic1D(10000,0.0f);
157
      Dynamic1D chromaDyn = new Dynamic1D(5000,0.0f);
149 158
      chromaDyn.add(new Static1D(0.0f));
150
      chromaDyn.add(new Static1D(0.5f));
159
      chromaDyn.add(new Static1D(1.0f));
151 160

  
152 161
      mQueues.chroma(chromaDyn, new Static3D(0,0,1) );
153 162
      

Also available in: Unified diff