Revision 698ad0a8
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java | ||
---|---|---|
35 | 35 |
import org.distorted.library.main.DistortedScreen; |
36 | 36 |
import org.distorted.library.main.DistortedTexture; |
37 | 37 |
import org.distorted.library.mesh.MeshBase; |
38 |
import org.distorted.library.mesh.MeshQuad; |
|
38 | 39 |
import org.distorted.library.mesh.MeshRectangles; |
39 | 40 |
import org.distorted.library.message.EffectListener; |
40 | 41 |
import org.distorted.library.type.Dynamic1D; |
... | ... | |
78 | 79 |
|
79 | 80 |
mLeaf = new DistortedTexture(); |
80 | 81 |
DistortedTexture surface = new DistortedTexture(); |
81 |
MeshBase mesh = new MeshRectangles(1,1); |
|
82 | 82 |
|
83 |
DistortedNode root = new DistortedNode(surface, new DistortedEffects(mRootW,mRootH,0), mesh); |
|
84 |
|
|
83 |
MeshQuad rootMesh = new MeshQuad(); |
|
84 |
rootMesh.setStretch(mRootW,mRootH,0); |
|
85 |
MeshQuad leafMesh = new MeshQuad(); |
|
86 |
leafMesh.setStretch(LEAF_SIZE,LEAF_SIZE,0); |
|
87 |
|
|
88 |
DistortedEffects rootEffects = new DistortedEffects(); |
|
89 |
DistortedNode root = new DistortedNode(surface, rootEffects, rootMesh); |
|
90 |
|
|
85 | 91 |
Static3D moveVector = new Static3D(0.55f*LEAF_SIZE, (mRootH-LEAF_SIZE)/2, 0); |
86 | 92 |
Static1D chromaLevel= new Static1D(0.5f); |
87 | 93 |
Static3D center = new Static3D(mRootW/2, mRootH/2, 0); |
... | ... | |
91 | 97 |
|
92 | 98 |
for(int j=0; j<NUM_LEAVES; j++) |
93 | 99 |
{ |
94 |
mLeafEffects[j] = new DistortedEffects(LEAF_SIZE,LEAF_SIZE,0);
|
|
100 |
mLeafEffects[j] = new DistortedEffects(); |
|
95 | 101 |
mLeafEffects[j].apply(leafMove); |
96 | 102 |
mLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) ); |
97 | 103 |
mLeafEffects[j].apply( new FragmentEffectChroma(chromaLevel, new Static3D(colors[3*j],colors[3*j+1], colors[3*j+2])) ); |
98 |
DistortedNode node = new DistortedNode( mLeaf, mLeafEffects[j], mesh);
|
|
104 |
DistortedNode node = new DistortedNode( mLeaf, mLeafEffects[j], leafMesh);
|
|
99 | 105 |
root.attach(node); |
100 | 106 |
} |
101 | 107 |
|
Also available in: Unified diff
Move the Effects.setStretch to Meshbase.setStretch