Skip to content

Commit ff53d2a

Browse files
Match colors
1 parent efb9662 commit ff53d2a

File tree

1 file changed

+38
-37
lines changed

1 file changed

+38
-37
lines changed

wasm/src/lib.rs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ impl State {
334334
mat4::from_y_rotation(&mut rot_y, PI / 2.0);
335335
let square1 = Facet {
336336
normal: [0.0, 0.0, 1.0],
337-
color: Color::GREEN,
337+
color: Color::CYAN,
338338
mesh: vec![
339339
b, 0., a, //
340340
0., b, a, //
@@ -343,14 +343,14 @@ impl State {
343343
],
344344
};
345345

346-
let square2 = square1.clone_with(&rot_x, Color::GREEN);
347-
let square3 = square2.clone_with(&rot_x, Color::GREEN);
348-
let square4 = square3.clone_with(&rot_x, Color::GREEN);
349-
let square5 = square1.clone_with(&rot_y, Color::GREEN);
350-
let square6 = square3.clone_with(&rot_y, Color::GREEN);
346+
let square2 = square1.clone_with(&rot_x, Color::VIOLET);
347+
let square3 = square2.clone_with(&rot_x, Color::LIGHT_RED);
348+
let square4 = square3.clone_with(&rot_x, Color::BLUE_VIOLET);
349+
let square5 = square1.clone_with(&rot_y, Color::SKY_BLUE);
350+
let square6 = square3.clone_with(&rot_y, Color::ORANGE);
351351

352352
let triangle1 = Facet {
353-
color: Color::MAGENTA,
353+
color: Color::WHITE,
354354
normal: [1., 1., 1.],
355355
mesh: vec![
356356
c, 0., c, //
@@ -360,15 +360,15 @@ impl State {
360360
};
361361

362362
let triangle2 = triangle1.clone_with(&rot_x, Color::MAGENTA);
363-
let triangle3 = triangle2.clone_with(&rot_x, Color::MAGENTA);
364-
let triangle4 = triangle3.clone_with(&rot_x, Color::MAGENTA);
365-
let triangle5 = triangle3.clone_with(&rot_y, Color::MAGENTA);
366-
let triangle6 = triangle4.clone_with(&rot_y, Color::MAGENTA);
367-
let triangle7 = triangle5.clone_with(&rot_y, Color::MAGENTA);
368-
let triangle8 = triangle6.clone_with(&rot_y, Color::MAGENTA);
363+
let triangle3 = triangle2.clone_with(&rot_x, Color::ORANGE);
364+
let triangle4 = triangle3.clone_with(&rot_x, Color::GREEN);
365+
let triangle5 = triangle3.clone_with(&rot_y, Color::YELLOW);
366+
let triangle6 = triangle4.clone_with(&rot_y, Color::SILVER);
367+
let triangle7 = triangle5.clone_with(&rot_y, Color::BLUE);
368+
let triangle8 = triangle6.clone_with(&rot_y, Color::CORAL);
369369

370370
let trapezoid1a = Facet {
371-
color: Color::LIGHT_PURPLE,
371+
color: Color::WHITE,
372372
normal: [1., 1., 1.],
373373
mesh: vec![
374374
c, 0., c, //
@@ -380,36 +380,36 @@ impl State {
380380

381381
let mut rot_oct1 = mat4::create();
382382
mat4::from_rotation(&mut rot_oct1, 2.0 * PI / 3.0, &[1., 1., 1.]);
383-
let trapezoid1b = trapezoid1a.clone_with(&rot_oct1, Color::LIGHT_PURPLE);
384-
let trapezoid1c = trapezoid1b.clone_with(&rot_oct1, Color::LIGHT_PURPLE);
383+
let trapezoid1b = trapezoid1a.clone_with(&rot_oct1, Color::WHITE);
384+
let trapezoid1c = trapezoid1b.clone_with(&rot_oct1, Color::WHITE);
385385

386-
let trapezoid2a = trapezoid1a.clone_with(&rot_x, Color::LIGHT_PURPLE);
387-
let trapezoid2b = trapezoid1b.clone_with(&rot_x, Color::LIGHT_PURPLE);
388-
let trapezoid2c = trapezoid1c.clone_with(&rot_x, Color::LIGHT_PURPLE);
386+
let trapezoid2a = trapezoid1a.clone_with(&rot_x, Color::MAGENTA);
387+
let trapezoid2b = trapezoid1b.clone_with(&rot_x, Color::MAGENTA);
388+
let trapezoid2c = trapezoid1c.clone_with(&rot_x, Color::MAGENTA);
389389

390-
let trapezoid3a = trapezoid2a.clone_with(&rot_x, Color::LIGHT_PURPLE);
391-
let trapezoid3b = trapezoid2b.clone_with(&rot_x, Color::LIGHT_PURPLE);
392-
let trapezoid3c = trapezoid2c.clone_with(&rot_x, Color::LIGHT_PURPLE);
390+
let trapezoid3a = trapezoid2a.clone_with(&rot_x, Color::ORANGE);
391+
let trapezoid3b = trapezoid2b.clone_with(&rot_x, Color::ORANGE);
392+
let trapezoid3c = trapezoid2c.clone_with(&rot_x, Color::ORANGE);
393393

394-
let trapezoid4a = trapezoid3a.clone_with(&rot_x, Color::LIGHT_PURPLE);
395-
let trapezoid4b = trapezoid3b.clone_with(&rot_x, Color::LIGHT_PURPLE);
396-
let trapezoid4c = trapezoid3c.clone_with(&rot_x, Color::LIGHT_PURPLE);
394+
let trapezoid4a = trapezoid3a.clone_with(&rot_x, Color::GREEN);
395+
let trapezoid4b = trapezoid3b.clone_with(&rot_x, Color::GREEN);
396+
let trapezoid4c = trapezoid3c.clone_with(&rot_x, Color::GREEN);
397397

398-
let trapezoid5a = trapezoid3a.clone_with(&rot_y, Color::LIGHT_RED);
399-
let trapezoid5b = trapezoid3b.clone_with(&rot_y, Color::LIGHT_RED);
400-
let trapezoid5c = trapezoid3c.clone_with(&rot_y, Color::LIGHT_RED);
398+
let trapezoid5a = trapezoid3a.clone_with(&rot_y, Color::YELLOW);
399+
let trapezoid5b = trapezoid3b.clone_with(&rot_y, Color::YELLOW);
400+
let trapezoid5c = trapezoid3c.clone_with(&rot_y, Color::YELLOW);
401401

402-
let trapezoid6a = trapezoid4a.clone_with(&rot_y, Color::LIGHT_RED);
403-
let trapezoid6b = trapezoid4b.clone_with(&rot_y, Color::LIGHT_RED);
404-
let trapezoid6c = trapezoid4c.clone_with(&rot_y, Color::LIGHT_RED);
402+
let trapezoid6a = trapezoid4a.clone_with(&rot_y, Color::SILVER);
403+
let trapezoid6b = trapezoid4b.clone_with(&rot_y, Color::SILVER);
404+
let trapezoid6c = trapezoid4c.clone_with(&rot_y, Color::SILVER);
405405

406-
let trapezoid7a = trapezoid5a.clone_with(&rot_y, Color::LIGHT_RED);
407-
let trapezoid7b = trapezoid5b.clone_with(&rot_y, Color::LIGHT_RED);
408-
let trapezoid7c = trapezoid5c.clone_with(&rot_y, Color::LIGHT_RED);
406+
let trapezoid7a = trapezoid5a.clone_with(&rot_y, Color::BLUE);
407+
let trapezoid7b = trapezoid5b.clone_with(&rot_y, Color::BLUE);
408+
let trapezoid7c = trapezoid5c.clone_with(&rot_y, Color::BLUE);
409409

410-
let trapezoid8a = trapezoid6a.clone_with(&rot_y, Color::LIGHT_RED);
411-
let trapezoid8b = trapezoid6b.clone_with(&rot_y, Color::LIGHT_RED);
412-
let trapezoid8c = trapezoid6c.clone_with(&rot_y, Color::LIGHT_RED);
410+
let trapezoid8a = trapezoid6a.clone_with(&rot_y, Color::CORAL);
411+
let trapezoid8b = trapezoid6b.clone_with(&rot_y, Color::CORAL);
412+
let trapezoid8c = trapezoid6c.clone_with(&rot_y, Color::CORAL);
413413

414414
facets.push(square1);
415415
facets.push(square2);
@@ -425,6 +425,7 @@ impl State {
425425
facets.push(triangle6);
426426
facets.push(triangle7);
427427
facets.push(triangle8);
428+
428429
facets.push(trapezoid1a);
429430
facets.push(trapezoid1b);
430431
facets.push(trapezoid1c);

0 commit comments

Comments
 (0)