Revision 880bdf97
Added by Leszek Koltunski about 8 years ago
src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java | ||
---|---|---|
49 | 49 |
private static final int NUM_LEAVES = 8; |
50 | 50 |
|
51 | 51 |
private GLSurfaceView mView; |
52 |
private DistortedNode[] mCircleNode; |
|
53 | 52 |
private DistortedNode mScreen; |
54 | 53 |
private DistortedBitmap mLeaf; |
55 |
private Dynamic1D mRot; |
|
56 |
|
|
54 |
|
|
57 | 55 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
58 | 56 |
|
59 | 57 |
OlimpicRenderer(GLSurfaceView v) |
... | ... | |
64 | 62 |
|
65 | 63 |
mScreen = new DistortedNode(new DistortedBitmap(9*LEAF_SIZE,9*LEAF_SIZE,1)); |
66 | 64 |
|
67 |
mRot = new Dynamic1D(5000,0.0f);
|
|
68 |
mRot.setMode(Dynamic1D.MODE_JUMP);
|
|
69 |
mRot.add(new Static1D( 0));
|
|
70 |
mRot.add(new Static1D(360));
|
|
65 |
Dynamic1D rot = new Dynamic1D(5000,0.0f);
|
|
66 |
rot.setMode(Dynamic1D.MODE_JUMP);
|
|
67 |
rot.add(new Static1D( 0));
|
|
68 |
rot.add(new Static1D(360));
|
|
71 | 69 |
|
72 |
mCircleNode = new DistortedNode[NUM_CIRCLES]; |
|
70 |
DistortedNode[] mCircleNode = new DistortedNode[NUM_CIRCLES];
|
|
73 | 71 |
|
74 | 72 |
int[] colors = new int[] {0,0,1, 0,0,0, 1,0,0, 1,1,0, 0,1,0}; // blue, black, red, yellow, green |
75 | 73 |
int[] positions = new int[] {0*LEAF_SIZE,2*LEAF_SIZE, 3*LEAF_SIZE,2*LEAF_SIZE, 6*LEAF_SIZE,2*LEAF_SIZE, 3*LEAF_SIZE/2,9*LEAF_SIZE/2, 9*LEAF_SIZE/2,9*LEAF_SIZE/2}; |
... | ... | |
101 | 99 |
mScreen.attach(mCircleNode[i]); |
102 | 100 |
tmp = (DistortedBitmap)mCircleNode[i].getObject(); |
103 | 101 |
tmp.move( new Static3D(positions[2*i], positions[2*i+1], 0) ); |
104 |
tmp.rotate( mRot, axis, center );
|
|
102 |
tmp.rotate( rot, axis, center );
|
|
105 | 103 |
tmp.chroma( new Static1D(0.5f), new Static3D(colors[3*i],colors[3*i+1], colors[3*i+2]) ); |
106 | 104 |
} |
107 | 105 |
} |
Also available in: Unified diff
Tidy up 'Olympic'