Revision d04a4886
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/fbo/FBORenderer.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
import org.distorted.examples.R; |
29 | 29 |
|
30 |
import org.distorted.library.DistortedEffects; |
|
30 | 31 |
import org.distorted.library.DistortedFramebuffer; |
31 |
import org.distorted.library.DistortedObjectTree;
|
|
32 |
import org.distorted.library.DistortedTree; |
|
32 | 33 |
import org.distorted.library.Distorted; |
33 | 34 |
import org.distorted.library.GridCubes; |
34 | 35 |
import org.distorted.library.GridFlat; |
35 | 36 |
import org.distorted.library.DistortedTexture; |
36 |
import org.distorted.library.DistortedEffectQueues; |
|
37 | 37 |
import org.distorted.library.EffectTypes; |
38 | 38 |
import org.distorted.library.type.Dynamic; |
39 | 39 |
import org.distorted.library.type.Dynamic1D; |
... | ... | |
50 | 50 |
class FBORenderer implements GLSurfaceView.Renderer |
51 | 51 |
{ |
52 | 52 |
private GLSurfaceView mView; |
53 |
private DistortedEffectQueues mEffects;
|
|
53 |
private DistortedEffects mEffects; |
|
54 | 54 |
private DistortedFramebuffer mScreen; |
55 |
private DistortedObjectTree mRoot;
|
|
55 |
private DistortedTree mRoot; |
|
56 | 56 |
private int lisaHeight, lisaWidth; |
57 | 57 |
|
58 | 58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
60 | 60 |
FBORenderer(GLSurfaceView v) |
61 | 61 |
{ |
62 | 62 |
mView = v; |
63 |
mEffects= new DistortedEffectQueues();
|
|
63 |
mEffects= new DistortedEffects(); |
|
64 | 64 |
mScreen = new DistortedFramebuffer(0); |
65 | 65 |
} |
66 | 66 |
|
... | ... | |
133 | 133 |
DistortedTexture text = new DistortedTexture(textWidth,textHeight); |
134 | 134 |
lisa.setTexture(bitmap1); |
135 | 135 |
text.setTexture(bitmap2); |
136 |
DistortedEffectQueues textQueues = new DistortedEffectQueues();
|
|
136 |
DistortedEffects textEffects = new DistortedEffects();
|
|
137 | 137 |
|
138 | 138 |
mEffects.abortAllEffects(); |
139 | 139 |
|
140 |
mRoot = new DistortedObjectTree(lisa, mEffects,new GridFlat(1,1));
|
|
141 |
mRoot.attach(text,textQueues,new GridCubes(20,5,false));
|
|
140 |
mRoot = new DistortedTree(lisa, mEffects,new GridFlat(1,1)); |
|
141 |
mRoot.attach(text,textEffects,new GridCubes(20,5,false));
|
|
142 | 142 |
|
143 | 143 |
float factor = lisaWidth/(2.0f*textWidth); |
144 | 144 |
|
145 |
textQueues.move( new Static3D( (lisaWidth-factor*textWidth)/2,(lisaHeight-factor*textHeight)/2,0) );
|
|
146 |
textQueues.scale(factor);
|
|
145 |
textEffects.move( new Static3D( (lisaWidth-factor*textWidth)/2,(lisaHeight-factor*textHeight)/2,0) );
|
|
146 |
textEffects.scale(factor);
|
|
147 | 147 |
|
148 | 148 |
Dynamic1D rotDyn = new Dynamic1D(12000,0.0f); |
149 | 149 |
rotDyn.add(new Static1D( 0)); |
150 | 150 |
rotDyn.add(new Static1D(360)); |
151 | 151 |
rotDyn.setMode(Dynamic.MODE_JUMP); |
152 | 152 |
|
153 |
textQueues.rotate(rotDyn, new Static3D(1,0,0), new Static3D(textWidth/2,textHeight/2,textHeight/10) );
|
|
153 |
textEffects.rotate(rotDyn, new Static3D(1,0,0), new Static3D(textWidth/2,textHeight/2,textHeight/10) );
|
|
154 | 154 |
|
155 | 155 |
Dynamic1D sinkDyn = new Dynamic1D(3000,0.0f); |
156 | 156 |
sinkDyn.add(new Static1D(1.0f)); |
157 | 157 |
sinkDyn.add(new Static1D(0.3f)); |
158 | 158 |
|
159 |
textQueues.sink(sinkDyn, new Static3D(textWidth/2,textHeight/2, 0));
|
|
159 |
textEffects.sink(sinkDyn, new Static3D(textWidth/2,textHeight/2, 0));
|
|
160 | 160 |
|
161 | 161 |
Dynamic1D chromaDyn = new Dynamic1D(5000,0.0f); |
162 | 162 |
chromaDyn.add(new Static1D(0.0f)); |
Also available in: Unified diff
Change of names.