Revision 08f92d82
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/examples/matrix3d/Matrix3DRenderer.java | ||
---|---|---|
28 | 28 |
import org.distorted.examples.R; |
29 | 29 |
|
30 | 30 |
import org.distorted.library.DistortedCubes; |
31 |
import org.distorted.library.EffectNames; |
|
31 | 32 |
import org.distorted.library.EffectTypes; |
32 | 33 |
import org.distorted.library.type.Dynamic3D; |
33 | 34 |
import org.distorted.library.type.Static3D; |
... | ... | |
49 | 50 |
private GLSurfaceView mView; |
50 | 51 |
private static DistortedCubes mCube; |
51 | 52 |
|
52 |
private static int[] order;
|
|
53 |
private static EffectNames[] order;
|
|
53 | 54 |
|
54 | 55 |
private static Dynamic3D mMoveInter, mScaleInter, mShearInter; |
55 | 56 |
private static Dynamic4D mDynamicRotate; |
... | ... | |
87 | 88 |
|
88 | 89 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
89 | 90 |
|
90 |
public static void setOrder(int[] effects)
|
|
91 |
public static void setOrder(EffectNames[] effects)
|
|
91 | 92 |
{ |
92 | 93 |
order = effects; |
93 | 94 |
setMatrixEffects(); |
... | ... | |
103 | 104 |
{ |
104 | 105 |
switch(order[i]) |
105 | 106 |
{ |
106 |
case Matrix3DActivity.MOVE : mCube.move(mMoveInter) ; break;
|
|
107 |
case Matrix3DActivity.SCALE : mCube.scale(mScaleInter) ; break;
|
|
108 |
case Matrix3DActivity.ROTATE: mCube.rotate(mDynamicRotate,mZeroPoint); break;
|
|
109 |
case Matrix3DActivity.SHEAR : mCube.shear(mShearInter, mZeroPoint) ; break;
|
|
107 |
case MOVE : mCube.move(mMoveInter) ; break; |
|
108 |
case SCALE : mCube.scale(mScaleInter) ; break; |
|
109 |
case ROTATE: mCube.rotate(mDynamicRotate,mZeroPoint); break; |
|
110 |
case SHEAR : mCube.shear(mShearInter, mZeroPoint) ; break; |
|
110 | 111 |
} |
111 | 112 |
} |
112 | 113 |
} |
... | ... | |
182 | 183 |
} |
183 | 184 |
catch(Exception ex) |
184 | 185 |
{ |
185 |
android.util.Log.e("Quaternion", ex.getMessage() );
|
|
186 |
android.util.Log.e("Matrix3D", ex.getMessage() );
|
|
186 | 187 |
} |
187 | 188 |
} |
188 | 189 |
} |
Also available in: Unified diff
Skeleton of the new App: Vertex3D. So far just a copy of Matrix3D.