Revision a8a553a5
Added by Leszek Koltunski over 5 years ago
| src/main/java/org/distorted/examples/meshjoin/MeshJoinRenderer.java | ||
|---|---|---|
| 139 | 139 |
{
|
| 140 | 140 |
final int[] FACE_COLORS = new int[] { 0xffffff00, 0xff00ff00, 0xff0000ff, 0xffff0000 };
|
| 141 | 141 |
final int FACES=FACE_COLORS.length; |
| 142 |
int SIZE = 128;
|
|
| 142 |
int SIZE = 200;
|
|
| 143 | 143 |
float STROKE = 0.05f*SIZE; |
| 144 | 144 |
float OFF = STROKE/2 -1; |
| 145 |
float OFF2 = 0.577f*SIZE + OFF;
|
|
| 145 |
float OFF2 = 0.5f*SIZE + OFF; |
|
| 146 | 146 |
float HEIGHT = SIZE - OFF; |
| 147 | 147 |
float RADIUS = SIZE/12; |
| 148 |
float ARC1_H = 0.31f*SIZE;
|
|
| 148 |
float ARC1_H = 0.2f*SIZE;
|
|
| 149 | 149 |
float ARC1_W = SIZE*0.5f; |
| 150 |
float ARC2_W = 0.152f*SIZE;
|
|
| 151 |
float ARC2_H = 0.91f*SIZE;
|
|
| 152 |
float ARC3_W = 0.847f*SIZE;
|
|
| 150 |
float ARC2_W = 0.153f*SIZE;
|
|
| 151 |
float ARC2_H = 0.905f*SIZE;
|
|
| 152 |
float ARC3_W = SIZE-ARC2_W;
|
|
| 153 | 153 |
|
| 154 | 154 |
Bitmap result = Bitmap.createBitmap(FACES*SIZE,SIZE, Bitmap.Config.ARGB_8888); |
| 155 | 155 |
Canvas canvas = new Canvas(result); |
| ... | ... | |
| 218 | 218 |
|
| 219 | 219 |
Static4D[] textureMaps = new Static4D[MESHES]; |
| 220 | 220 |
|
| 221 |
for(int i=0; i<MESHES; i++) textureMaps[i] = new Static4D(i*0.25f,0.0f,0.25f,0.866f);
|
|
| 221 |
for(int i=0; i<MESHES; i++) textureMaps[i] = new Static4D(i*0.25f,0.0f,0.25f,1.0f);
|
|
| 222 | 222 |
|
| 223 | 223 |
MeshBase result = new MeshJoined(meshes); |
| 224 | 224 |
result.setTextureMap(textureMaps); |
Also available in: Unified diff
Progress with Pyraminx.