Revision dae661e9
Added by Leszek Koltunski over 6 years ago
| src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java | ||
|---|---|---|
| 69 | 69 |
mView = view; |
| 70 | 70 |
mManager = new AroundTheWorldEffectsManager(); |
| 71 | 71 |
mEffects = new DistortedEffects(); |
| 72 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 73 | 72 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 73 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 74 | 74 |
|
| 75 | 75 |
mManager.apply(mEffects); |
| 76 | 76 |
mScreen = new DistortedScreen(); |
| src/main/java/org/distorted/examples/bean/BeanRenderer.java | ||
|---|---|---|
| 91 | 91 |
mEffects = new DistortedEffects(); |
| 92 | 92 |
mEffects.apply( new VertexEffectDistort(dynLeft , pointLeft , regionLeft) ); |
| 93 | 93 |
mEffects.apply( new VertexEffectDistort(dynRight, pointRight, regionRight)); |
| 94 |
mEffects.apply( new MatrixEffectMove (mMove ) ); |
|
| 95 | 94 |
mEffects.apply( new MatrixEffectScale(mScale) ); |
| 95 |
mEffects.apply( new MatrixEffectMove (mMove ) ); |
|
| 96 | 96 |
|
| 97 | 97 |
mScreen = new DistortedScreen(); |
| 98 | 98 |
} |
| src/main/java/org/distorted/examples/blur/BlurRenderer.java | ||
|---|---|---|
| 79 | 79 |
mBufferScale= new Static3D(1,1,1); |
| 80 | 80 |
|
| 81 | 81 |
mBufferEffects = new DistortedEffects(); |
| 82 |
mBufferEffects.apply(new MatrixEffectMove(mBufferMove)); |
|
| 83 | 82 |
mBufferEffects.apply(new MatrixEffectScale(mBufferScale)); |
| 83 |
mBufferEffects.apply(new MatrixEffectMove(mBufferMove)); |
|
| 84 | 84 |
|
| 85 | 85 |
mEffects = new DistortedEffects(); |
| 86 | 86 |
mEffects.apply( new PostprocessEffectBlur(radiusDyn) ); |
| 87 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 88 | 87 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 88 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 89 | 89 |
} |
| 90 | 90 |
|
| 91 | 91 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java | ||
|---|---|---|
| 93 | 93 |
diRotate.add(new Static1D(360)); |
| 94 | 94 |
|
| 95 | 95 |
mEffects = new DistortedEffects(); |
| 96 |
|
|
| 97 |
mEffects.apply( new MatrixEffectRotate( diRotate, new Static3D(0,0,1), mRotate) ); |
|
| 98 |
mEffects.apply( new MatrixEffectScale(diScale)); |
|
| 99 |
mEffects.apply( new MatrixEffectMove(moveDyn)); |
|
| 100 |
|
|
| 96 | 101 |
mEffects.apply( new FragmentEffectChroma( chromaDyn, new Static3D(1,0,0), chromaCenter, chromaRegion ,true) ); |
| 97 | 102 |
mEffects.apply( new FragmentEffectAlpha(alphaDyn, alphaCenter, alphaRegion, false) ); |
| 98 |
mEffects.apply( new MatrixEffectMove(moveDyn)); |
|
| 99 |
mEffects.apply( new MatrixEffectScale(diScale)); |
|
| 100 |
mEffects.apply( new MatrixEffectRotate( diRotate, new Static3D(0,0,1), mRotate) ); |
|
| 101 | 103 |
|
| 102 | 104 |
mScreen = new DistortedScreen(); |
| 103 | 105 |
} |
| src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
|---|---|---|
| 93 | 93 |
mCenter = new Static3D(0,0,0); |
| 94 | 94 |
|
| 95 | 95 |
mEffects = new DistortedEffects(); |
| 96 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 97 | 96 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 97 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 98 | 98 |
|
| 99 | 99 |
// Try adding 2 Vertex Effects to the Bitmap. |
| 100 | 100 |
// This will fail if we have set maxVertexEffects to something < 2. |
| src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java | ||
|---|---|---|
| 93 | 93 |
{
|
| 94 | 94 |
mMove[i] = new Static3D(0,0,0); |
| 95 | 95 |
moveEffect[i] = new MatrixEffectMove(mMove[i]); |
| 96 |
mEffects[i].apply(moveEffect[i]); |
|
| 97 | 96 |
mEffects[i].apply(scaleEffect); |
| 97 |
mEffects[i].apply(moveEffect[i]); |
|
| 98 | 98 |
} |
| 99 | 99 |
|
| 100 | 100 |
mScreen = new DistortedScreen(); |
| src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java | ||
|---|---|---|
| 113 | 113 |
{
|
| 114 | 114 |
mMove[i] = new Static3D(0,0,0); |
| 115 | 115 |
moveEffect[i] = new MatrixEffectMove(mMove[i]); |
| 116 |
mEffects[i].apply(moveEffect[i]); |
|
| 117 | 116 |
mEffects[i].apply(scaleEffect); |
| 117 |
mEffects[i].apply(moveEffect[i]); |
|
| 118 | 118 |
} |
| 119 | 119 |
|
| 120 | 120 |
mScreen = new DistortedScreen(); |
| src/main/java/org/distorted/examples/earth/EarthRenderer.java | ||
|---|---|---|
| 132 | 132 |
quatInt2.add(mQuat2); |
| 133 | 133 |
|
| 134 | 134 |
mEffects = new DistortedEffects(); |
| 135 |
mEffects.apply( new MatrixEffectMove(mMove) ); |
|
| 136 |
mEffects.apply( new MatrixEffectScale(scale)); |
|
| 137 |
mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) ); |
|
| 138 | 135 |
mEffects.apply( new MatrixEffectQuaternion(quatInt2, mCenter) ); |
| 136 |
mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) ); |
|
| 137 |
mEffects.apply( new MatrixEffectScale(scale)); |
|
| 138 |
mEffects.apply( new MatrixEffectMove(mMove) ); |
|
| 139 | 139 |
|
| 140 | 140 |
mScreen = new DistortedScreen(); |
| 141 | 141 |
mScreen.setProjection(FOV, NEAR); |
| src/main/java/org/distorted/examples/flag/FlagRenderer.java | ||
|---|---|---|
| 92 | 92 |
mScale = new Static3D(1,1,1); |
| 93 | 93 |
mCenter= new Static3D(0,0,0); |
| 94 | 94 |
|
| 95 |
effects.apply( new MatrixEffectMove(mMove)); |
|
| 96 |
effects.apply( new MatrixEffectScale(mScale)); |
|
| 97 |
effects.apply( new MatrixEffectQuaternion(mQuat1, mCenter) ); |
|
| 98 | 95 |
effects.apply( new MatrixEffectQuaternion(mQuat2, mCenter) ); |
| 96 |
effects.apply( new MatrixEffectQuaternion(mQuat1, mCenter) ); |
|
| 97 |
effects.apply( new MatrixEffectScale(mScale)); |
|
| 98 |
effects.apply( new MatrixEffectMove(mMove)); |
|
| 99 | 99 |
|
| 100 | 100 |
final int GRIDX = 50; |
| 101 | 101 |
final int GRIDY = 30; |
| src/main/java/org/distorted/examples/generic/GenericRenderer.java | ||
|---|---|---|
| 129 | 129 |
MatrixEffectQuaternion quat2cen = new MatrixEffectQuaternion(mQuat2, mRotateCen); |
| 130 | 130 |
MatrixEffectMove centerMove = new MatrixEffectMove(mCenterPoint); |
| 131 | 131 |
|
| 132 |
centerEffects.apply(quat1cen); |
|
| 133 |
centerEffects.apply(quat2cen); |
|
| 134 |
centerEffects.apply( new MatrixEffectMove(mMoveCenter) ); |
|
| 135 |
centerEffects.apply( centerMove ); |
|
| 136 | 132 |
centerEffects.apply( new MatrixEffectScale(mScaleCenter) ); |
| 133 |
centerEffects.apply( centerMove ); |
|
| 134 |
centerEffects.apply( new MatrixEffectMove(mMoveCenter) ); |
|
| 135 |
centerEffects.apply(quat2cen); |
|
| 136 |
centerEffects.apply(quat1cen); |
|
| 137 | 137 |
|
| 138 |
regionEffects.apply(quat1cen); |
|
| 139 |
regionEffects.apply(quat2cen); |
|
| 140 |
regionEffects.apply( new MatrixEffectMove(mMoveRegion) ); |
|
| 141 |
regionEffects.apply( centerMove ); |
|
| 142 |
regionEffects.apply( new MatrixEffectMove(mRegionPoint) ); |
|
| 143 |
regionEffects.apply( new MatrixEffectScale(mRegionScalePoint) ); |
|
| 144 | 138 |
regionEffects.apply( new MatrixEffectMove(new Static3D( -regionSize*0.5f , -regionSize*0.5f , 0)) ); |
| 139 |
regionEffects.apply( new MatrixEffectScale(mRegionScalePoint) ); |
|
| 140 |
regionEffects.apply( new MatrixEffectMove(mRegionPoint) ); |
|
| 141 |
regionEffects.apply( centerMove ); |
|
| 142 |
regionEffects.apply( new MatrixEffectMove(mMoveRegion) ); |
|
| 143 |
regionEffects.apply(quat2cen); |
|
| 144 |
regionEffects.apply(quat1cen); |
|
| 145 | 145 |
|
| 146 | 146 |
resetMatrixEffects(); |
| 147 | 147 |
|
| 148 | 148 |
// quite tricky: move the background exactly to the FAR plane! (see InternalOutputSurface.setProjection() ) |
| 149 |
backgroundEffects.apply(new MatrixEffectMove(mMoveBackground) ); |
|
| 150 | 149 |
backgroundEffects.apply(new MatrixEffectScale(mScaleBackground) ); |
| 150 |
backgroundEffects.apply(new MatrixEffectMove(mMoveBackground) ); |
|
| 151 | 151 |
} |
| 152 | 152 |
|
| 153 | 153 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 161 | 161 |
MatrixEffectQuaternion quat1obj = new MatrixEffectQuaternion(mQuat1, rotateObj); |
| 162 | 162 |
MatrixEffectQuaternion quat2obj = new MatrixEffectQuaternion(mQuat2, rotateObj); |
| 163 | 163 |
|
| 164 |
objectEffects.apply( new MatrixEffectMove(mMoveObject)); |
|
| 165 |
objectEffects.apply( new MatrixEffectScale(mScaleObject) ); |
|
| 166 |
objectEffects.apply(quat1obj); |
|
| 167 | 164 |
objectEffects.apply(quat2obj); |
| 165 |
objectEffects.apply(quat1obj); |
|
| 166 |
objectEffects.apply( new MatrixEffectScale(mScaleObject) ); |
|
| 167 |
objectEffects.apply( new MatrixEffectMove(mMoveObject)); |
|
| 168 | 168 |
|
| 169 | 169 |
mQuat1.set(0,0,0,1); |
| 170 | 170 |
mQuat2.set(0,0,0,1); |
| src/main/java/org/distorted/examples/girl/GirlRenderer.java | ||
|---|---|---|
| 125 | 125 |
|
| 126 | 126 |
mMove = new Static3D(0,0,0); |
| 127 | 127 |
mScale= new Static3D(1,1,1); |
| 128 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 129 | 128 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 129 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 130 | 130 |
|
| 131 | 131 |
mScreen = new DistortedScreen(); |
| 132 | 132 |
} |
| src/main/java/org/distorted/examples/glow/GlowRenderer.java | ||
|---|---|---|
| 75 | 75 |
mGlow = new PostprocessEffectGlow(mRadius,mColor); |
| 76 | 76 |
|
| 77 | 77 |
DistortedEffects effects = new DistortedEffects(); |
| 78 |
effects.apply(new MatrixEffectMove(mMove)); |
|
| 79 | 78 |
effects.apply(new MatrixEffectScale(mScale)); |
| 79 |
effects.apply(new MatrixEffectMove(mMove)); |
|
| 80 | 80 |
effects.apply(mGlow); |
| 81 | 81 |
|
| 82 | 82 |
mScreen = new DistortedScreen(); |
| src/main/java/org/distorted/examples/inflate/InflateRenderer.java | ||
|---|---|---|
| 88 | 88 |
quatInt2.add(mQuat2); |
| 89 | 89 |
|
| 90 | 90 |
mEffects = new DistortedEffects(); |
| 91 |
mEffects.apply( new MatrixEffectMove(mMove) ); |
|
| 92 |
mEffects.apply( new MatrixEffectScale(mScale)); |
|
| 93 |
mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) ); |
|
| 94 | 91 |
mEffects.apply( new MatrixEffectQuaternion(quatInt2, mCenter) ); |
| 92 |
mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) ); |
|
| 93 |
mEffects.apply( new MatrixEffectScale(mScale)); |
|
| 94 |
mEffects.apply( new MatrixEffectMove(mMove) ); |
|
| 95 | 95 |
mEffects.apply( new FragmentEffectAlpha(mAlpha)); |
| 96 | 96 |
|
| 97 | 97 |
mScreen = new DistortedScreen(); |
| src/main/java/org/distorted/examples/listener/ListenerRenderer.java | ||
|---|---|---|
| 72 | 72 |
|
| 73 | 73 |
mMove = new Static3D(0,0,0); |
| 74 | 74 |
mScale= new Static3D(1,1,1); |
| 75 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 76 | 75 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 76 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 77 | 77 |
} |
| 78 | 78 |
|
| 79 | 79 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/mirror/MirrorRenderer.java | ||
|---|---|---|
| 91 | 91 |
mEffectsMirror.apply( new MatrixEffectScale(mScaleMirror)); |
| 92 | 92 |
mEffectsOffscreen1.apply( new MatrixEffectScale( new Static3D(MIRROR_SCALE,MIRROR_SCALE,MIRROR_SCALE))); |
| 93 | 93 |
mEffectsOffscreen2.apply( new MatrixEffectMove(mMoveOffscreen2) ); |
| 94 |
mEffectsHead.apply( new MatrixEffectMove(mHeadPosition) ); |
|
| 95 | 94 |
mEffectsHead.apply( new MatrixEffectScale(mScaleHead) ); |
| 95 |
mEffectsHead.apply( new MatrixEffectMove(mHeadPosition) ); |
|
| 96 | 96 |
mEffectsOffscreen1.apply(new FragmentEffectBrightness(new Static1D(MIRROR_BRIGHTNESS))); |
| 97 | 97 |
} |
| 98 | 98 |
|
| src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java | ||
|---|---|---|
| 90 | 90 |
|
| 91 | 91 |
mMove = new Static3D(0,0,0); |
| 92 | 92 |
mScale= new Static3D(1,1,1); |
| 93 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 94 | 93 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 94 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 95 | 95 |
|
| 96 | 96 |
mScreen = new DistortedScreen(); |
| 97 | 97 |
} |
| src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java | ||
|---|---|---|
| 92 | 92 |
for(int j=0; j<NUM_LEAVES; j++) |
| 93 | 93 |
{
|
| 94 | 94 |
mLeafEffects[j] = new DistortedEffects(); |
| 95 |
mLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) ); |
|
| 96 | 95 |
mLeafEffects[j].apply(leafMove); |
| 96 |
mLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) ); |
|
| 97 | 97 |
mLeafEffects[j].apply( new FragmentEffectChroma(chromaLevel, new Static3D(colors[3*j],colors[3*j+1], colors[3*j+2])) ); |
| 98 | 98 |
DistortedNode node = new DistortedNode( mLeaf, mLeafEffects[j], mesh); |
| 99 | 99 |
root.attach(node); |
| ... | ... | |
| 108 | 108 |
rot.add(new Static1D(360)); |
| 109 | 109 |
|
| 110 | 110 |
DistortedEffects effects = root.getEffects(); |
| 111 |
effects.apply(new MatrixEffectMove(mMove)); |
|
| 112 |
effects.apply(new MatrixEffectScale(mScale)); |
|
| 113 | 111 |
effects.apply( new MatrixEffectRotate(rot, axis, center) ); |
| 112 |
effects.apply(new MatrixEffectScale(mScale)); |
|
| 113 |
effects.apply(new MatrixEffectMove(mMove)); |
|
| 114 | 114 |
|
| 115 | 115 |
Dynamic1D radiusDyn = new Dynamic1D(FLASH_TIME,1.0f); |
| 116 | 116 |
radiusDyn.add(new Static1D( 0)); |
| src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java | ||
|---|---|---|
| 132 | 132 |
|
| 133 | 133 |
for(int i=0; i<NUM_OBJECTS; i++) |
| 134 | 134 |
{
|
| 135 |
effects[i].apply(moveEffect); |
|
| 136 |
effects[i].apply(scaleEffect); |
|
| 137 |
effects[i].apply(quatEffect1); |
|
| 138 |
effects[i].apply(quatEffect2); |
|
| 139 | 135 |
effects[i].apply(new MatrixEffectMove(mMoveVector[i])); |
| 136 |
effects[i].apply(quatEffect2); |
|
| 137 |
effects[i].apply(quatEffect1); |
|
| 138 |
effects[i].apply(scaleEffect); |
|
| 139 |
effects[i].apply(moveEffect); |
|
| 140 | 140 |
} |
| 141 | 141 |
} |
| 142 | 142 |
|
| src/main/java/org/distorted/examples/objecttree/ObjectTreeRenderer.java | ||
|---|---|---|
| 79 | 79 |
chromaDyn.add(new Static1D(0.8f)); |
| 80 | 80 |
|
| 81 | 81 |
mEffects= new DistortedEffects(); |
| 82 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 83 | 82 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 83 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 84 | 84 |
mEffects.apply(new FragmentEffectChroma(chromaDyn, new Static3D(0,0,1))); |
| 85 | 85 |
|
| 86 | 86 |
mScreen = new DistortedScreen(); |
| ... | ... | |
| 202 | 202 |
float factor = lisaWidth/(2.0f*gridWidth); |
| 203 | 203 |
MatrixEffectMove move = new MatrixEffectMove( new Static3D((lisaWidth-factor*gridWidth)/2,(lisaHeight-factor*gridHeight)/2, gridWidth/(2.0f*GRID))); |
| 204 | 204 |
MatrixEffectScale scale = new MatrixEffectScale( new Static3D(factor,factor,factor) ); |
| 205 |
gridEffects.apply(move); |
|
| 206 | 205 |
gridEffects.apply(scale); |
| 206 |
gridEffects.apply(move); |
|
| 207 | 207 |
|
| 208 | 208 |
Dynamic1D rotDyn = new Dynamic1D(12000,0.0f); |
| 209 | 209 |
rotDyn.add(new Static1D( 0)); |
| src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java | ||
|---|---|---|
| 100 | 100 |
mScale= new Static3D(1,1,1); |
| 101 | 101 |
|
| 102 | 102 |
DistortedEffects effects = new DistortedEffects(); |
| 103 |
effects.apply(new MatrixEffectMove(mMove)); |
|
| 104 | 103 |
effects.apply(new MatrixEffectScale(mScale)); |
| 104 |
effects.apply(new MatrixEffectMove(mMove)); |
|
| 105 | 105 |
|
| 106 | 106 |
mScreenW = 9*LEAF_SIZE; |
| 107 | 107 |
mScreenH = 9*LEAF_SIZE; |
| ... | ... | |
| 122 | 122 |
for(int j=0; j<NUM_LEAVES; j++) |
| 123 | 123 |
{
|
| 124 | 124 |
mEffects[j] = new DistortedEffects(); |
| 125 |
mEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) ); |
|
| 126 | 125 |
mEffects[j].apply(new MatrixEffectMove(moveVector)); |
| 126 |
mEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) ); |
|
| 127 | 127 |
} |
| 128 | 128 |
|
| 129 | 129 |
for(int i=0; i<NUM_CIRCLES; i++) |
| 130 | 130 |
{
|
| 131 | 131 |
effects = new DistortedEffects(); |
| 132 |
effects.apply( new MatrixEffectMove(new Static3D(positions[2*i], positions[2*i+1], 0)) ); |
|
| 133 | 132 |
effects.apply( new MatrixEffectRotate(rot, axis, center) ); |
| 133 |
effects.apply( new MatrixEffectMove(new Static3D(positions[2*i], positions[2*i+1], 0)) ); |
|
| 134 | 134 |
effects.apply( new FragmentEffectChroma(new Static1D(0.5f), new Static3D(colors[3*i],colors[3*i+1], colors[3*i+2])) ); |
| 135 | 135 |
|
| 136 | 136 |
mCircleNode[i] = new DistortedNode( surface, effects, mMesh); |
| src/main/java/org/distorted/examples/plainmonalisa/RenderThread.java | ||
|---|---|---|
| 101 | 101 |
|
| 102 | 102 |
mMove = new Static3D(0,0,0); |
| 103 | 103 |
mScale= new Static3D(1,1,1); |
| 104 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 105 | 104 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 105 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 106 | 106 |
|
| 107 | 107 |
mScreen = new DistortedScreen(); |
| 108 | 108 |
} |
| src/main/java/org/distorted/examples/postprocesstree/PostprocessTreeRenderer.java | ||
|---|---|---|
| 89 | 89 |
|
| 90 | 90 |
DistortedNode root = new DistortedNode(new DistortedTexture(mScreenW,mScreenH), rootEffects, mesh); |
| 91 | 91 |
|
| 92 |
rootEffects.apply(new MatrixEffectMove(mMove)); |
|
| 93 | 92 |
rootEffects.apply(new MatrixEffectScale(mScale)); |
| 93 |
rootEffects.apply(new MatrixEffectMove(mMove)); |
|
| 94 | 94 |
rootEffects.apply(blurEffect); |
| 95 | 95 |
|
| 96 | 96 |
Dynamic1D rotate = new Dynamic1D(5000,0.0f); |
| ... | ... | |
| 108 | 108 |
for(int j=0; j<NUM_LEAVES; j++) |
| 109 | 109 |
{
|
| 110 | 110 |
outerLeafEffects[j] = new DistortedEffects(); |
| 111 |
outerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, outerCenter) ); |
|
| 112 | 111 |
outerLeafEffects[j].apply(new MatrixEffectMove(outerMoveVector)); |
| 112 |
outerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, outerCenter) ); |
|
| 113 | 113 |
|
| 114 | 114 |
root.attach(mLeaf, outerLeafEffects[j], mesh); |
| 115 | 115 |
} |
| 116 | 116 |
|
| 117 |
innerEffects.apply( new MatrixEffectMove(new Static3D( (OUTER-INNER)*LEAF_SIZE/2,(OUTER-INNER)*LEAF_SIZE/2, 0)) ); |
|
| 118 | 117 |
innerEffects.apply( new MatrixEffectRotate(rotate, axis, innerCenter) ); |
| 118 |
innerEffects.apply( new MatrixEffectMove(new Static3D( (OUTER-INNER)*LEAF_SIZE/2,(OUTER-INNER)*LEAF_SIZE/2, 0)) ); |
|
| 119 | 119 |
innerEffects.apply( new FragmentEffectChroma(new Static1D(0.5f), new Static3D(1,0,0) ) ); |
| 120 | 120 |
innerEffects.apply(blurEffect); |
| 121 | 121 |
|
| ... | ... | |
| 125 | 125 |
for(int j=0; j<NUM_LEAVES; j++) |
| 126 | 126 |
{
|
| 127 | 127 |
innerLeafEffects[j] = new DistortedEffects(); |
| 128 |
innerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, innerCenter) ); |
|
| 129 | 128 |
innerLeafEffects[j].apply(new MatrixEffectMove(innerMoveVector)); |
| 129 |
innerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, innerCenter) ); |
|
| 130 | 130 |
|
| 131 | 131 |
innerNode.attach( mLeaf, innerLeafEffects[j], mesh ); |
| 132 | 132 |
} |
| src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java | ||
|---|---|---|
| 92 | 92 |
mScale = new Static3D(1,1,1); |
| 93 | 93 |
mCenter = new Static3D(0,0,0); |
| 94 | 94 |
|
| 95 |
effects.apply( new MatrixEffectMove(mMove)); |
|
| 96 |
effects.apply(new MatrixEffectScale(mScale)); |
|
| 97 | 95 |
effects.apply( new MatrixEffectQuaternion(rot,mCenter) ); |
| 96 |
effects.apply( new MatrixEffectScale(mScale)); |
|
| 97 |
effects.apply( new MatrixEffectMove(mMove)); |
|
| 98 | 98 |
|
| 99 | 99 |
mScreen = new DistortedScreen(); |
| 100 | 100 |
mScreen.attach(mTexture,effects,mMesh); |
| src/main/java/org/distorted/examples/rubik/RubikCube.java | ||
|---|---|---|
| 139 | 139 |
mRotate[x][y][z] = new MatrixEffectRotate( mRotationAngle[x][y][z], mRotationAxis[x][y][z], center); |
| 140 | 140 |
|
| 141 | 141 |
mEffects[x][y][z] = new DistortedEffects(); |
| 142 |
mEffects[x][y][z].apply(sinkEffect); |
|
| 143 |
mEffects[x][y][z].apply(moveEffect); |
|
| 144 |
mEffects[x][y][z].apply(scaleEffect); |
|
| 145 |
mEffects[x][y][z].apply(quatEffect); |
|
| 146 |
mEffects[x][y][z].apply( mRotate[x][y][z] ); |
|
| 147 | 142 |
mEffects[x][y][z].apply( new MatrixEffectMove(cubeVectors[x][y][z]) ); |
| 143 |
mEffects[x][y][z].apply( mRotate[x][y][z] ); |
|
| 144 |
mEffects[x][y][z].apply(quatEffect); |
|
| 145 |
mEffects[x][y][z].apply(scaleEffect); |
|
| 146 |
mEffects[x][y][z].apply(moveEffect); |
|
| 147 |
mEffects[x][y][z].apply(sinkEffect); |
|
| 148 | 148 |
} |
| 149 | 149 |
} |
| 150 | 150 |
} |
| src/main/java/org/distorted/examples/save/SaveRenderer.java | ||
|---|---|---|
| 96 | 96 |
mEffects = new DistortedEffects(); |
| 97 | 97 |
mEffects.apply( new VertexEffectSink(diSink, pLeft , sinkRegion) ); |
| 98 | 98 |
mEffects.apply( new VertexEffectSink(diSink, pRight, sinkRegion) ); |
| 99 |
mEffects.apply( new MatrixEffectMove(mMove)); |
|
| 100 | 99 |
mEffects.apply( new MatrixEffectScale(mScaleMain)); |
| 101 | 100 |
mEffects.apply( new MatrixEffectScale(mScaleFactor)); |
| 101 |
mEffects.apply( new MatrixEffectMove(mMove)); |
|
| 102 | 102 |
|
| 103 | 103 |
mScreen = new DistortedScreen(); |
| 104 | 104 |
} |
| src/main/java/org/distorted/examples/sink/SinkRenderer.java | ||
|---|---|---|
| 71 | 71 |
|
| 72 | 72 |
mScale = new Static3D(1,1,1); |
| 73 | 73 |
mMove = new Static3D(0,0,0); |
| 74 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 75 | 74 |
mEffects.apply(new MatrixEffectScale(mScale)); |
| 75 |
mEffects.apply(new MatrixEffectMove(mMove)); |
|
| 76 | 76 |
|
| 77 | 77 |
mScreen = new DistortedScreen(); |
| 78 | 78 |
} |
| src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java | ||
|---|---|---|
| 223 | 223 |
randomAlpha1 = 0.2f + 0.8f*mRnd.nextFloat(); |
| 224 | 224 |
randomAlpha2 = 0.8f + 0.2f*mRnd.nextFloat(); |
| 225 | 225 |
randomTime = 500+mRnd.nextInt(2000); |
| 226 |
|
|
| 227 |
mStarEffects[i].apply( new MatrixEffectMove(new Static3D(randomX,randomY,0)) ); |
|
| 228 |
mStarEffects[i].apply( new MatrixEffectScale(randomS) ); |
|
| 226 |
|
|
| 229 | 227 |
mStarEffects[i].apply( new MatrixEffectRotate(new Static1D(randomA), axis, center) ); |
| 230 |
|
|
| 228 |
mStarEffects[i].apply( new MatrixEffectScale(randomS) ); |
|
| 229 |
mStarEffects[i].apply( new MatrixEffectMove(new Static3D(randomX,randomY,0)) ); |
|
| 230 |
|
|
| 231 | 231 |
Dynamic1D di = new Dynamic1D(randomTime,0.0f); |
| 232 | 232 |
di.setNoise(alphaNoise); |
| 233 | 233 |
di.add(new Static1D(randomAlpha1)); |
| ... | ... | |
| 249 | 249 |
alpha.notifyWhenFinished(this); |
| 250 | 250 |
alphaEffectID = alpha.getID(); |
| 251 | 251 |
|
| 252 |
mGFFAEffects.apply( new MatrixEffectMove(new Static3D(w/5,2*h/3,0)) ); |
|
| 253 | 252 |
mGFFAEffects.apply( new MatrixEffectScale(scale) ); |
| 253 |
mGFFAEffects.apply( new MatrixEffectMove(new Static3D(w/5,2*h/3,0)) ); |
|
| 254 | 254 |
mGFFAEffects.apply( alpha ); |
| 255 | 255 |
|
| 256 | 256 |
mScreen.attach(mGFFATexture, mGFFAEffects, mQuad); |
| ... | ... | |
| 392 | 392 |
scale.notifyWhenFinished(this); |
| 393 | 393 |
scaleEffectID = scale.getID(); |
| 394 | 394 |
|
| 395 |
mLogoEffects.apply( new MatrixEffectMove(new Static3D(screenW/2,screenH/2,0)) ); |
|
| 396 |
mLogoEffects.apply( scale ); |
|
| 397 | 395 |
mLogoEffects.apply( new MatrixEffectMove(new Static3D(-logoW/2,-logoH/2,0)) ); |
| 398 |
|
|
| 396 |
mLogoEffects.apply( scale ); |
|
| 397 |
mLogoEffects.apply( new MatrixEffectMove(new Static3D(screenW/2,screenH/2,0)) ); |
|
| 398 |
|
|
| 399 | 399 |
mScreen.attach(mLogoTexture, mLogoEffects,mQuad); |
| 400 | 400 |
} |
| 401 | 401 |
else if( effectID == scaleEffectID ) |
| ... | ... | |
| 423 | 423 |
move.notifyWhenFinished(this); |
| 424 | 424 |
moveEffectID = move.getID(); |
| 425 | 425 |
|
| 426 |
mCrawlEffects.apply( move ); |
|
| 427 |
mCrawlEffects.apply( new MatrixEffectScale(new Static3D(scale,scale,scale)) ); |
|
| 428 | 426 |
mCrawlEffects.apply( new MatrixEffectMove(new Static3D(-crawlW/2,-crawlH/2,0)) ); |
| 429 |
|
|
| 427 |
mCrawlEffects.apply( new MatrixEffectScale(new Static3D(scale,scale,scale)) ); |
|
| 428 |
mCrawlEffects.apply( move ); |
|
| 429 |
|
|
| 430 | 430 |
mBackground = mScreen.attach(mCrawlBackgroundTexture, mCrawlBackgroundEffects,mQuad); |
| 431 | 431 |
mBackground.attach(mCrawlTexture, mCrawlEffects,mQuad); |
| 432 | 432 |
mBackground.glDisable(GLES31.GL_DEPTH_TEST); |
| src/main/java/org/distorted/examples/stencil/StencilRenderer.java | ||
|---|---|---|
| 162 | 162 |
// middle of the screen. |
| 163 | 163 |
///////////////////////////////////////////////////////////////////////////////////////////////////// |
| 164 | 164 |
// The cube |
| 165 |
cube1Effects.apply( move2 ); |
|
| 166 |
cube1Effects.apply( rotaX ); |
|
| 167 |
cube1Effects.apply( rotaZ ); |
|
| 168 |
cube1Effects.apply( scale ); |
|
| 169 | 165 |
cube1Effects.apply( move1 ); |
| 166 |
cube1Effects.apply( scale ); |
|
| 167 |
cube1Effects.apply( rotaZ ); |
|
| 168 |
cube1Effects.apply( rotaX ); |
|
| 169 |
cube1Effects.apply( move2 ); |
|
| 170 | 170 |
///////////////////////////////////////////////////////////////////////////////////////////////////// |
| 171 | 171 |
// Floor |
| 172 |
floorEffects.apply( move2 ); |
|
| 173 |
floorEffects.apply( rotaX ); |
|
| 174 |
floorEffects.apply( rotaZ ); |
|
| 175 | 172 |
floorEffects.apply( scale ); |
| 173 |
floorEffects.apply( rotaZ ); |
|
| 174 |
floorEffects.apply( rotaX ); |
|
| 175 |
floorEffects.apply( move2 ); |
|
| 176 | 176 |
///////////////////////////////////////////////////////////////////////////////////////////////////// |
| 177 | 177 |
// Reflection |
| 178 |
cube2Effects.apply( move2 ); |
|
| 179 |
cube2Effects.apply( rotaX ); |
|
| 180 |
cube2Effects.apply( rotaZ ); |
|
| 181 |
cube2Effects.apply( scale ); |
|
| 182 |
cube2Effects.apply( move1 ); |
|
| 183 | 178 |
cube2Effects.apply( new MatrixEffectScale(new Static3D(1,1,-1)) ); |
| 179 |
cube2Effects.apply( move1 ); |
|
| 180 |
cube2Effects.apply( scale ); |
|
| 181 |
cube2Effects.apply( rotaZ ); |
|
| 182 |
cube2Effects.apply( rotaX ); |
|
| 183 |
cube2Effects.apply( move2 ); |
|
| 184 | 184 |
cube2Effects.apply( new FragmentEffectBrightness(new Static1D(0.5f)) ); |
| 185 | 185 |
|
| 186 | 186 |
///////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java | ||
|---|---|---|
| 114 | 114 |
|
| 115 | 115 |
mEffects[i].apply(mBlur[i]); |
| 116 | 116 |
mEffects[i].apply(alpha[i]); |
| 117 |
mEffects[i].apply(moveEffect); |
|
| 118 |
mEffects[i].apply(scaleEffect); |
|
| 119 |
mEffects[i].apply(quatEffect1); |
|
| 120 |
mEffects[i].apply(quatEffect2); |
|
| 121 | 117 |
mEffects[i].apply(new MatrixEffectMove(mMoveVector[i])); |
| 118 |
mEffects[i].apply(quatEffect2); |
|
| 119 |
mEffects[i].apply(quatEffect1); |
|
| 120 |
mEffects[i].apply(scaleEffect); |
|
| 121 |
mEffects[i].apply(moveEffect); |
|
| 122 | 122 |
|
| 123 | 123 |
mNode[i] = new DistortedNode(mTex[i], mEffects[i], mesh ); |
| 124 | 124 |
mScreen.attach(mNode[i]); |
| src/main/java/org/distorted/examples/triblur/TriblurRenderer.java | ||
|---|---|---|
| 130 | 130 |
|
| 131 | 131 |
effects[i].apply(mBlur[i]); |
| 132 | 132 |
effects[i].apply(chroma[i]); |
| 133 |
effects[i].apply( (i==0||i==NUM_OBJECTS-1) ? moveEffect1 : moveEffect2 ); |
|
| 134 |
effects[i].apply( (i==0||i==NUM_OBJECTS-1) ? scaleEffect1 : scaleEffect2 ); |
|
| 135 |
effects[i].apply(quatEffect1); |
|
| 136 |
effects[i].apply(quatEffect2); |
|
| 133 |
|
|
| 137 | 134 |
effects[i].apply(new MatrixEffectMove(moveVector[i])); |
| 135 |
effects[i].apply(quatEffect2); |
|
| 136 |
effects[i].apply(quatEffect1); |
|
| 137 |
effects[i].apply( (i==0||i==NUM_OBJECTS-1) ? scaleEffect1 : scaleEffect2 ); |
|
| 138 |
effects[i].apply( (i==0||i==NUM_OBJECTS-1) ? moveEffect1 : moveEffect2 ); |
|
| 138 | 139 |
|
| 139 | 140 |
mEffectStatus[i] = 1; |
| 140 | 141 |
mNode[i] = new DistortedNode(mTex, effects[i], mesh ); |
| src/main/java/org/distorted/examples/wind/WindEffectsManager.java | ||
|---|---|---|
| 112 | 112 |
|
| 113 | 113 |
setWind(0); |
| 114 | 114 |
|
| 115 |
effects.apply( new MatrixEffectShear(shearFactor,midLeft) ); |
|
| 116 | 115 |
effects.apply( new MatrixEffectScale(scaleFactor) ); |
| 116 |
effects.apply( new MatrixEffectShear(shearFactor,midLeft) ); |
|
| 117 | 117 |
effects.apply( new VertexEffectDeform(deformForce,midRight) ); |
| 118 | 118 |
effects.apply( new VertexEffectWave(windDynamic1, midRight, windRegion) ); |
| 119 | 119 |
effects.apply( new VertexEffectWave(windDynamic2, midRight, windRegion) ); |
| src/main/java/org/distorted/examples/wind/WindRenderer.java | ||
|---|---|---|
| 73 | 73 |
mObjWidth = mTexture.getWidth(); |
| 74 | 74 |
mObjHeight= mTexture.getHeight(); |
| 75 | 75 |
|
| 76 |
mManager.apply(effects); |
|
| 77 |
|
|
| 76 | 78 |
mMove = new Static3D(0,0,0); |
| 77 | 79 |
mScale= new Static3D(1,1,1); |
| 78 |
effects.apply( new MatrixEffectMove(mMove)); |
|
| 79 |
effects.apply( new MatrixEffectScale(mScale)); |
|
| 80 | 80 |
|
| 81 | 81 |
Static1D angle = new Static1D(-45); |
| 82 | 82 |
Static3D axis = new Static3D(0,0,1); |
| 83 | 83 |
Static3D center= new Static3D(0,mObjHeight/2,0); |
| 84 | 84 |
|
| 85 | 85 |
effects.apply( new MatrixEffectRotate(angle, axis, center) ); |
| 86 |
mManager.apply(effects); |
|
| 86 |
effects.apply( new MatrixEffectScale(mScale)); |
|
| 87 |
effects.apply( new MatrixEffectMove(mMove)); |
|
| 87 | 88 |
} |
| 88 | 89 |
|
| 89 | 90 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Invert the order of Matrix Effects. Now, just as in the other queues, the first matrix effect is actually the first to act on the object - not the other way around!