import processing.serial.*; import processing.opengl.*; import toxi.geom.*; import toxi.processing.*; // NOTE: requires ToxicLibs to be installed in order to run properly. // 1. Download from http://toxiclibs.org/downloads // 2. Extract into [userdir]/Processing/libraries // (location may be different on Mac/Linux) // 3. Run and bask in awesomeness ToxiclibsSupport gfx; Serial port; // The serial port char[] teapotPacket = new char[14]; // InvenSense Teapot packet int serialCount = 0; // current packet byte position int aligned = 0; int interval = 0; float[] q = new float[4]; Quaternion quat = new Quaternion(1, 0, 0, 0); float[] gravity = new float[3]; float[] euler = new float[3]; float[] ypr = new float[3]; void setup() { // 800px square viewport using OpenGL rendering size(800, 800, OPENGL); gfx = new ToxiclibsSupport(this); // setup lights and antialiasing lights(); smooth(); // display serial port list for debugging/clarity println(Serial.list()); // get the first available port (use EITHER this OR the specific port code below) //String portName = "/dev/ttyUSB1"; // get a specific serial port (use EITHER this OR the first-available code above) String portName = "COM38"; // open the serial port port = new Serial(this, portName, 115200); // send single character to trigger DMP init/start // (expected by MPU6050_DMP6 example Arduino sketch) port.write('r'); } void draw() { if (millis() - interval > 1000) { // resend single character to trigger DMP init/start // in case the MPU is halted/reset while applet is running port.write('r'); interval = millis(); } fill(255, 255, 255, 200); //Boat shape noStroke(); beginShape(); rotate(PI); translate(-250, -250); vertex(160.712, 612.761); bezierVertex(160.428, 612.303, 159.566, 609.033, 158.795, 605.495); bezierVertex(158.025, 601.958, 156.319, 594.633, 155.006, 589.219); bezierVertex(151.596, 575.167, 143.035, 532.083, 139.17, 509.532); bezierVertex(128.047, 444.619, 121.255, 373.785, 119.348, 302.813); bezierVertex(118.544, 272.864, 117.541, 266.532, 113.069, 263.162); bezierVertex(112.167, 262.482, 111.424, 261.422, 111.418, 260.807); bezierVertex(111.412, 260.192, 109.823, 258.001, 107.885, 255.938); bezierVertex(105.947, 253.876, 103.756, 250.922, 103.015, 249.376); bezierVertex(101.191, 245.567, 100.547, 212.705, 102.023, 198.751); bezierVertex(103.893, 181.08, 108.27, 159.707, 112.556, 147.323); bezierVertex(113.612, 144.272, 114.475, 140.779, 114.475, 139.56); bezierVertex(114.475, 138.341, 114.778, 137.344, 115.148, 137.344); bezierVertex(115.517, 137.344, 116.99, 134.286, 118.42, 130.547); bezierVertex(120.902, 124.059, 128.244, 108.331, 129.251, 107.344); bezierVertex(129.514, 107.087, 130.91, 104.555, 132.355, 101.719); bezierVertex(137.475, 91.665, 141.565, 85.245, 147.756, 77.542); bezierVertex(149.948, 74.815, 151.741, 72.28, 151.741, 71.908); bezierVertex(151.741, 71.536, 152.705, 70.181, 153.883, 68.897); bezierVertex(155.061, 67.613, 158.506, 63.61, 161.538, 60.001); bezierVertex(164.571, 56.391, 168.232, 52.213, 169.675, 50.716); bezierVertex(171.118, 49.219, 172.072, 47.627, 171.794, 47.177); bezierVertex(171.516, 46.728, 171.724, 46.476, 172.256, 46.618); bezierVertex(173.496, 46.948, 184.507, 36.361, 183.731, 35.584); bezierVertex(183.41, 35.263, 183.576, 35.141, 184.1, 35.313); bezierVertex(184.981, 35.602, 187.9, 33.482, 196.613, 26.222); bezierVertex(198.488, 24.659, 201.816, 22.175, 204.009, 20.702); bezierVertex(206.202, 19.229, 208.958, 17.132, 210.133, 16.043); bezierVertex(211.308, 14.954, 212.678, 13.96, 213.177, 13.834); bezierVertex(213.676, 13.708, 218.093, 11.129, 222.991, 8.102); bezierVertex(227.89, 5.076, 235.818, 0.592, 240.609, -1.862); vertex(249.32, -6.324); vertex(256.546, -2.748); bezierVertex(260.521, -0.782, 266.452, 2.434, 269.728, 4.398); bezierVertex(273.003, 6.362, 275.879, 7.969, 276.118, 7.969); bezierVertex(276.358, 7.969, 277.936, 9.024, 279.626, 10.313); bezierVertex(281.317, 11.602, 282.988, 12.657, 283.341, 12.657); bezierVertex(283.694, 12.657, 286.619, 14.661, 289.842, 17.11); bezierVertex(293.064, 19.559, 297.165, 22.601, 298.955, 23.869); bezierVertex(300.745, 25.137, 303.475, 27.296, 305.022, 28.667); bezierVertex(306.569, 30.039, 310.893, 33.767, 314.632, 36.952); bezierVertex(318.37, 40.138, 321.429, 43.217, 321.429, 43.794); bezierVertex(321.429, 44.372, 321.68, 44.593, 321.988, 44.285); bezierVertex(322.295, 43.978, 324.868, 46.333, 327.704, 49.52); bezierVertex(330.541, 52.706, 333.77, 55.806, 334.88, 56.409); bezierVertex(335.989, 57.012, 336.897, 57.915, 336.897, 58.416); bezierVertex(336.897, 58.917, 339.114, 62.009, 341.824, 65.289); bezierVertex(344.534, 68.568, 347.11, 71.695, 347.548, 72.238); bezierVertex(347.987, 72.781, 349.517, 74.996, 350.949, 77.16); bezierVertex(352.381, 79.324, 353.816, 81.094, 354.137, 81.094); bezierVertex(354.458, 81.094, 355.309, 82.423, 356.028, 84.048); bezierVertex(356.747, 85.672, 358.116, 87.782, 359.07, 88.735); bezierVertex(360.023, 89.689, 360.572, 90.469, 360.29, 90.469); bezierVertex(360.007, 90.469, 361.004, 92.262, 362.505, 94.454); bezierVertex(364.006, 96.645, 365.544, 99.426, 365.922, 100.633); bezierVertex(366.421, 102.227, 367.112, 102.697, 368.448, 102.348); bezierVertex(369.899, 101.968, 370.067, 102.131, 369.245, 103.121); bezierVertex(368.453, 104.075, 369.088, 106.134, 371.895, 111.719); bezierVertex(386.468, 140.717, 394.833, 171.67, 397.452, 206.294); bezierVertex(398.594, 221.384, 397.946, 243.205, 396.208, 248.212); bezierVertex(395.628, 249.883, 392.525, 254.457, 389.313, 258.376); bezierVertex(380.67, 268.921, 380.525, 269.598, 379.518, 303.966); bezierVertex(378.732, 330.805, 377.503, 357.103, 376.308, 372.657); bezierVertex(371.331, 437.473, 363.543, 493.924, 351.024, 555.938); bezierVertex(346.757, 577.074, 340.027, 607.94, 338.707, 612.422); bezierVertex(338.435, 613.349, 319.84, 613.594, 249.795, 613.594); bezierVertex(199.135, 613.594, 161.006, 613.238, 160.712, 612.761); endShape(); beginShape(); vertex(336.314, 605.86); bezierVertex(339.453, 594.126, 347.917, 555.256, 351.368, 536.719); bezierVertex(356.21, 510.708, 362.905, 468.56, 362.509, 466.579); bezierVertex(362.439, 466.227, 362.617, 465.305, 362.905, 464.532); bezierVertex(365.506, 457.555, 373.022, 376.931, 374.791, 337.032); bezierVertex(376.858, 290.417, 376.877, 287.181, 375.076, 287.527); bezierVertex(373.643, 287.801, 373.436, 289.434, 373.246, 301.887); bezierVertex(372.443, 354.791, 365.096, 436.985, 356.153, 493.126); bezierVertex(351.672, 521.26, 342.587, 568.129, 337.453, 589.605); bezierVertex(335.963, 595.838, 334.456, 602.311, 334.105, 603.99); vertex(333.465, 607.042); vertex(249.44, 606.802); vertex(165.415, 606.563); vertex(160.443, 585.001); bezierVertex(157.709, 573.141, 155.254, 561.962, 154.988, 560.157); bezierVertex(154.722, 558.352, 152.853, 548.438, 150.835, 538.126); bezierVertex(136.993, 467.413, 128.283, 387.144, 125.886, 308.204); bezierVertex(125.346, 290.417, 125.042, 287.344, 123.823, 287.344); bezierVertex(122.565, 287.344, 122.472, 290.004, 123.04, 309.61); bezierVertex(123.621, 329.645, 125.687, 368.63, 126.879, 382.032); bezierVertex(127.131, 384.868, 127.786, 392.462, 128.335, 398.907); bezierVertex(130.881, 428.793, 135.975, 468.183, 141.976, 504.376); bezierVertex(147.907, 540.148, 156.575, 583.454, 158.958, 589.219); bezierVertex(159.277, 589.993, 159.463, 590.969, 159.37, 591.389); bezierVertex(159.277, 591.808, 159.6, 593.707, 160.087, 595.607); bezierVertex(160.574, 597.508, 161.457, 601.489, 162.048, 604.454); vertex(163.124, 609.844); vertex(249.186, 609.844); vertex(335.247, 609.844); vertex(336.314, 605.86); endShape(); beginShape(); vertex(330.92, 603.032); bezierVertex(329.994, 602.113, 329.886, 602.221, 330.395, 603.557); bezierVertex(330.747, 604.481, 331.271, 605.002, 331.56, 604.713); bezierVertex(331.849, 604.424, 331.561, 603.668, 330.92, 603.032); endShape(); beginShape(); vertex(325.753, 599.297); vertex(322.595, 594.376); vertex(249.638, 594.376); vertex(176.68, 594.376); vertex(173.462, 598.594); vertex(170.244, 602.813); vertex(249.352, 603.29); bezierVertex(292.861, 603.552, 328.562, 603.868, 328.686, 603.993); bezierVertex(328.81, 604.117, 327.491, 602.005, 325.753, 599.297); endShape(); beginShape(); vertex(336.305, 577.969); bezierVertex(343.65, 544.065, 346.328, 530.644, 348.093, 518.907); bezierVertex(348.364, 517.102, 349.441, 510.774, 350.487, 504.844); bezierVertex(353.563, 487.395, 359.647, 443.704, 361.257, 427.501); bezierVertex(362.077, 419.251, 362.945, 411.235, 363.187, 409.688); bezierVertex(364.988, 398.152, 368.618, 338.838, 369.778, 301.988); vertex(370.365, 283.351); vertex(366.756, 283.991); bezierVertex(359.398, 285.297, 359.866, 284.445, 359.863, 296.548); bezierVertex(359.856, 322.719, 356.73, 378.437, 353.252, 414.376); bezierVertex(352.255, 424.688, 351.436, 435.889, 351.433, 439.266); bezierVertex(351.43, 442.644, 351.064, 445.808, 350.619, 446.297); bezierVertex(350.173, 446.787, 349.097, 452.883, 348.227, 459.844); bezierVertex(343.916, 494.343, 335.547, 544.044, 328.516, 576.901); vertex(325.27, 592.073); vertex(328.139, 596.325); bezierVertex(329.718, 598.663, 331.127, 600.447, 331.271, 600.289); bezierVertex(331.415, 600.13, 333.681, 590.087, 336.305, 577.969); endShape(); beginShape(); vertex(171.961, 594.376); bezierVertex(172.865, 592.227, 172.886, 591.244, 172.052, 590.211); bezierVertex(171.182, 589.135, 171.226, 589.02, 172.268, 589.648); bezierVertex(173.291, 590.264, 173.454, 589.945, 173.014, 588.187); bezierVertex(168.731, 571.078, 155.062, 495.537, 153.184, 478.594); bezierVertex(152.87, 475.758, 151.764, 467.532, 150.727, 460.313); bezierVertex(148.058, 441.73, 148.273, 443.75, 145.234, 408.751); bezierVertex(141.659, 367.584, 140.479, 347.504, 139.657, 313.827); bezierVertex(139.288, 298.675, 138.59, 286.043, 138.099, 285.597); bezierVertex(137.61, 285.154, 135.35, 284.339, 133.076, 283.786); vertex(128.942, 282.78); vertex(129.559, 308.734); bezierVertex(130.721, 357.593, 135.159, 412.617, 141.975, 462.657); bezierVertex(146.892, 498.753, 156.628, 553.092, 162.888, 579.376); bezierVertex(163.871, 583.501, 165.188, 589.196, 165.815, 592.032); bezierVertex(167.623, 600.205, 167.476, 599.93, 169.24, 598.466); bezierVertex(170.086, 597.764, 171.311, 595.923, 171.961, 594.376); endShape(); beginShape(); vertex(285.1, 592.267); bezierVertex(264.862, 592.125, 231.745, 592.125, 211.507, 592.267); bezierVertex(191.268, 592.408, 207.827, 592.523, 248.304, 592.523); bezierVertex(288.78, 592.523, 305.339, 592.408, 285.1, 592.267); endShape(); beginShape(); vertex(324.161, 580.079); bezierVertex(325.344, 574.02, 326.682, 567.797, 327.135, 566.251); bezierVertex(330.624, 554.335, 345.798, 459.652, 345.803, 449.766); vertex(345.804, 447.657); vertex(249.199, 447.657); vertex(152.594, 447.657); vertex(153.135, 450.704); bezierVertex(153.433, 452.38, 154.693, 461.766, 155.936, 471.563); bezierVertex(159.546, 500.02, 171.038, 565.344, 176.594, 588.985); vertex(177.089, 591.094); vertex(249.55, 591.094); vertex(322.011, 591.094); vertex(324.161, 580.079); endShape(); beginShape(); vertex(174.807, 587.598); bezierVertex(174.496, 587.287, 174.274, 587.84, 174.315, 588.829); bezierVertex(174.36, 589.921, 174.582, 590.143, 174.881, 589.395); bezierVertex(175.152, 588.718, 175.119, 587.91, 174.807, 587.598); endShape(); beginShape(); vertex(142.932, 519.161); bezierVertex(142.621, 518.849, 142.399, 519.403, 142.44, 520.391); bezierVertex(142.485, 521.483, 142.707, 521.705, 143.006, 520.958); bezierVertex(143.277, 520.281, 143.244, 519.472, 142.932, 519.161); endShape(); beginShape(); vertex(338.87, 512.598); bezierVertex(338.558, 512.287, 338.337, 512.84, 338.378, 513.829); bezierVertex(338.423, 514.921, 338.645, 515.143, 338.944, 514.395); bezierVertex(339.215, 513.718, 339.181, 512.91, 338.87, 512.598); endShape(); beginShape(); vertex(145.745, 497.598); bezierVertex(145.433, 497.287, 145.212, 497.84, 145.253, 498.829); bezierVertex(145.298, 499.921, 145.52, 500.143, 145.819, 499.395); bezierVertex(146.09, 498.718, 146.056, 497.91, 145.745, 497.598); endShape(); beginShape(); vertex(156.057, 485.411); bezierVertex(155.746, 485.099, 155.524, 485.653, 155.565, 486.641); bezierVertex(155.61, 487.733, 155.832, 487.955, 156.131, 487.208); bezierVertex(156.402, 486.531, 156.369, 485.722, 156.057, 485.411); endShape(); beginShape(); vertex(142.987, 480.235); bezierVertex(142.727, 479.59, 142.514, 480.118, 142.514, 481.407); bezierVertex(142.514, 482.696, 142.727, 483.223, 142.987, 482.579); bezierVertex(143.247, 481.934, 143.247, 480.88, 142.987, 480.235); endShape(); beginShape(); vertex(136.37, 478.848); bezierVertex(136.058, 478.537, 135.837, 479.09, 135.878, 480.079); bezierVertex(135.923, 481.171, 136.145, 481.393, 136.444, 480.645); bezierVertex(136.715, 479.968, 136.681, 479.16, 136.37, 478.848); endShape(); beginShape(); vertex(155.174, 478.36); bezierVertex(154.914, 477.715, 154.702, 478.243, 154.702, 479.532); bezierVertex(154.702, 480.821, 154.914, 481.348, 155.174, 480.704); bezierVertex(155.435, 480.059, 155.435, 479.005, 155.174, 478.36); endShape(); beginShape(); vertex(344.495, 475.098); bezierVertex(344.183, 474.787, 343.962, 475.34, 344.003, 476.329); bezierVertex(344.048, 477.421, 344.27, 477.643, 344.569, 476.895); bezierVertex(344.84, 476.218, 344.806, 475.41, 344.495, 475.098); endShape(); beginShape(); vertex(154.182, 470.411); bezierVertex(153.871, 470.099, 153.649, 470.653, 153.69, 471.641); bezierVertex(153.735, 472.733, 153.957, 472.955, 154.256, 472.208); bezierVertex(154.527, 471.531, 154.494, 470.722, 154.182, 470.411); endShape(); beginShape(); vertex(141.057, 466.661); bezierVertex(140.746, 466.349, 140.524, 466.903, 140.565, 467.891); bezierVertex(140.61, 468.983, 140.832, 469.205, 141.131, 468.458); bezierVertex(141.402, 467.781, 141.369, 466.972, 141.057, 466.661); endShape(); beginShape(); vertex(134.495, 465.723); bezierVertex(134.183, 465.412, 133.962, 465.965, 134.003, 466.954); bezierVertex(134.048, 468.046, 134.27, 468.268, 134.569, 467.52); bezierVertex(134.84, 466.843, 134.806, 466.035, 134.495, 465.723); endShape(); beginShape(); vertex(153.245, 462.911); bezierVertex(152.933, 462.599, 152.712, 463.153, 152.753, 464.141); bezierVertex(152.798, 465.233, 153.02, 465.455, 153.319, 464.708); bezierVertex(153.59, 464.031, 153.556, 463.222, 153.245, 462.911); endShape(); beginShape(); vertex(365.12, 462.911); bezierVertex(364.808, 462.599, 364.587, 463.153, 364.628, 464.141); bezierVertex(364.673, 465.233, 364.895, 465.455, 365.194, 464.708); bezierVertex(365.465, 464.031, 365.431, 463.222, 365.12, 462.911); endShape(); beginShape(); vertex(140.12, 460.098); bezierVertex(139.808, 459.787, 139.587, 460.34, 139.628, 461.329); bezierVertex(139.673, 462.421, 139.895, 462.643, 140.194, 461.895); bezierVertex(140.465, 461.218, 140.431, 460.41, 140.12, 460.098); endShape(); beginShape(); vertex(346.37, 460.098); bezierVertex(346.058, 459.787, 345.837, 460.34, 345.878, 461.329); bezierVertex(345.923, 462.421, 346.145, 462.643, 346.444, 461.895); bezierVertex(346.715, 461.218, 346.681, 460.41, 346.37, 460.098); endShape(); beginShape(); vertex(138.245, 446.973); bezierVertex(137.933, 446.662, 137.712, 447.215, 137.753, 448.204); bezierVertex(137.798, 449.296, 138.02, 449.518, 138.319, 448.77); bezierVertex(138.59, 448.093, 138.556, 447.285, 138.245, 446.973); endShape(); beginShape(); vertex(131.682, 445.098); bezierVertex(131.371, 444.787, 131.149, 445.34, 131.19, 446.329); bezierVertex(131.235, 447.421, 131.457, 447.643, 131.756, 446.895); bezierVertex(132.027, 446.218, 131.994, 445.41, 131.682, 445.098); endShape(); beginShape(); vertex(361.424, 442.735); bezierVertex(361.164, 442.09, 360.952, 442.618, 360.952, 443.907); bezierVertex(360.952, 445.196, 361.164, 445.723, 361.424, 445.079); bezierVertex(361.685, 444.434, 361.685, 443.38, 361.424, 442.735); endShape(); beginShape(); vertex(347.679, 332.344); vertex(347.679, 220.782); vertex(249.71, 220.782); vertex(151.741, 220.782); vertex(151.741, 332.344); vertex(151.741, 443.907); vertex(249.71, 443.907); vertex(347.679, 443.907); vertex(347.679, 332.344); endShape(); beginShape(); vertex(137.362, 438.047); bezierVertex(137.102, 437.403, 136.889, 437.93, 136.889, 439.219); bezierVertex(136.889, 440.508, 137.102, 441.036, 137.362, 440.391); bezierVertex(137.622, 439.747, 137.622, 438.692, 137.362, 438.047); endShape(); beginShape(); vertex(130.745, 436.661); bezierVertex(130.433, 436.349, 130.212, 436.903, 130.253, 437.891); bezierVertex(130.298, 438.983, 130.52, 439.205, 130.819, 438.458); bezierVertex(131.09, 437.781, 131.056, 436.972, 130.745, 436.661); endShape(); beginShape(); vertex(149.495, 431.036); bezierVertex(149.183, 430.724, 148.962, 431.278, 149.003, 432.266); bezierVertex(149.048, 433.358, 149.27, 433.58, 149.569, 432.833); bezierVertex(149.84, 432.156, 149.806, 431.347, 149.495, 431.036); endShape(); beginShape(); vertex(136.37, 430.098); bezierVertex(136.058, 429.787, 135.837, 430.34, 135.878, 431.329); bezierVertex(135.923, 432.421, 136.145, 432.643, 136.444, 431.895); bezierVertex(136.715, 431.218, 136.681, 430.41, 136.37, 430.098); endShape(); beginShape(); vertex(351.075, 414.178); bezierVertex(349.73, 412.833, 349.186, 416.138, 349.577, 423.282); bezierVertex(349.796, 427.284, 349.856, 427.174, 350.733, 421.131); bezierVertex(351.242, 417.628, 351.396, 414.499, 351.075, 414.178); endShape(); beginShape(); vertex(369.862, 423.985); bezierVertex(369.602, 423.34, 369.389, 423.868, 369.389, 425.157); bezierVertex(369.389, 426.446, 369.602, 426.973, 369.862, 426.329); bezierVertex(370.122, 425.684, 370.122, 424.63, 369.862, 423.985); endShape(); beginShape(); vertex(135.487, 421.172); bezierVertex(135.227, 420.528, 135.014, 421.055, 135.014, 422.344); bezierVertex(135.014, 423.633, 135.227, 424.161, 135.487, 423.516); bezierVertex(135.747, 422.872, 135.747, 421.817, 135.487, 421.172); endShape(); beginShape(); vertex(128.87, 420.723); bezierVertex(128.558, 420.412, 128.337, 420.965, 128.378, 421.954); bezierVertex(128.423, 423.046, 128.645, 423.268, 128.944, 422.52); bezierVertex(129.215, 421.843, 129.181, 421.035, 128.87, 420.723); endShape(); beginShape(); vertex(149.178, 413.435); bezierVertex(148.605, 408.068, 148.545, 407.962, 147.852, 411.094); bezierVertex(147.023, 414.838, 147.834, 421.001, 149.002, 419.833); bezierVertex(149.429, 419.406, 149.508, 416.527, 149.178, 413.435); endShape(); beginShape(); vertex(370.745, 416.036); bezierVertex(370.433, 415.724, 370.212, 416.278, 370.253, 417.266); bezierVertex(370.298, 418.358, 370.52, 418.58, 370.819, 417.833); bezierVertex(371.09, 417.156, 371.056, 416.347, 370.745, 416.036); endShape(); beginShape(); vertex(127.932, 412.286); bezierVertex(127.621, 411.974, 127.399, 412.528, 127.44, 413.516); bezierVertex(127.485, 414.608, 127.707, 414.83, 128.006, 414.083); bezierVertex(128.277, 413.406, 128.244, 412.597, 127.932, 412.286); endShape(); beginShape(); vertex(134.495, 412.286); bezierVertex(134.183, 411.974, 133.962, 412.528, 134.003, 413.516); bezierVertex(134.048, 414.608, 134.27, 414.83, 134.569, 414.083); bezierVertex(134.84, 413.406, 134.806, 412.597, 134.495, 412.286); endShape(); beginShape(); vertex(351.995, 409.473); bezierVertex(351.683, 409.162, 351.462, 409.715, 351.503, 410.704); bezierVertex(351.548, 411.796, 351.77, 412.018, 352.069, 411.27); bezierVertex(352.34, 410.593, 352.306, 409.785, 351.995, 409.473); endShape(); beginShape(); vertex(365.174, 408.047); bezierVertex(364.914, 407.403, 364.702, 407.93, 364.702, 409.219); bezierVertex(364.702, 410.508, 364.914, 411.036, 365.174, 410.391); bezierVertex(365.435, 409.747, 365.435, 408.692, 365.174, 408.047); endShape(); beginShape(); vertex(133.606, 403.342); bezierVertex(133.349, 402.707, 133.155, 403.454, 133.174, 405.001); bezierVertex(133.193, 406.547, 133.403, 407.067, 133.641, 406.155); bezierVertex(133.878, 405.242, 133.863, 403.977, 133.606, 403.342); endShape(); beginShape(); vertex(146.737, 403.36); bezierVertex(146.477, 402.715, 146.264, 403.243, 146.264, 404.532); bezierVertex(146.264, 405.821, 146.477, 406.348, 146.737, 405.704); bezierVertex(146.997, 405.059, 146.997, 404.004, 146.737, 403.36); endShape(); beginShape(); vertex(351.112, 402.422); bezierVertex(350.852, 401.778, 350.639, 402.305, 350.639, 403.594); bezierVertex(350.639, 404.883, 350.852, 405.411, 351.112, 404.766); bezierVertex(351.372, 404.122, 351.372, 403.067, 351.112, 402.422); endShape(); beginShape(); vertex(352.987, 400.547); bezierVertex(352.727, 399.903, 352.514, 400.43, 352.514, 401.719); bezierVertex(352.514, 403.008, 352.727, 403.536, 352.987, 402.891); bezierVertex(353.247, 402.247, 353.247, 401.192, 352.987, 400.547); endShape(); beginShape(); vertex(366.057, 397.286); bezierVertex(365.746, 396.974, 365.524, 397.528, 365.565, 398.516); bezierVertex(365.61, 399.608, 365.832, 399.83, 366.131, 399.083); bezierVertex(366.402, 398.406, 366.369, 397.597, 366.057, 397.286); endShape(); beginShape(); vertex(372.674, 395.86); bezierVertex(372.414, 395.215, 372.202, 395.743, 372.202, 397.032); bezierVertex(372.202, 398.321, 372.414, 398.848, 372.674, 398.204); bezierVertex(372.935, 397.559, 372.935, 396.504, 372.674, 395.86); endShape(); beginShape(); vertex(132.674, 392.11); bezierVertex(132.414, 391.465, 132.202, 391.993, 132.202, 393.282); bezierVertex(132.202, 394.571, 132.414, 395.098, 132.674, 394.454); bezierVertex(132.935, 393.809, 132.935, 392.754, 132.674, 392.11); endShape(); beginShape(); vertex(145.799, 392.11); bezierVertex(145.539, 391.465, 145.327, 391.993, 145.327, 393.282); bezierVertex(145.327, 394.571, 145.539, 395.098, 145.799, 394.454); bezierVertex(146.06, 393.809, 146.06, 392.754, 145.799, 392.11); endShape(); beginShape(); vertex(126.057, 390.723); bezierVertex(125.746, 390.412, 125.524, 390.965, 125.565, 391.954); bezierVertex(125.61, 393.046, 125.832, 393.268, 126.131, 392.52); bezierVertex(126.402, 391.843, 126.369, 391.035, 126.057, 390.723); endShape(); beginShape(); vertex(147.991, 323.282); bezierVertex(147.991, 284.782, 147.758, 253.515, 147.473, 253.799); bezierVertex(147.189, 254.084, 146.037, 259.112, 144.915, 264.971); bezierVertex(143.073, 274.59, 142.896, 278.223, 143.097, 302.344); bezierVertex(143.343, 331.968, 146.418, 393.282, 147.657, 393.282); bezierVertex(147.841, 393.282, 147.991, 361.782, 147.991, 323.282); endShape(); beginShape(); vertex(354.75, 344.063); bezierVertex(356.702, 306.746, 356.234, 275.225, 353.535, 262.26); bezierVertex(352.542, 257.487, 351.556, 253.409, 351.344, 253.198); bezierVertex(350.992, 252.845, 351.185, 388.797, 351.54, 390.938); bezierVertex(351.87, 392.924, 353.246, 372.829, 354.75, 344.063); endShape(); beginShape(); vertex(353.924, 387.422); bezierVertex(353.664, 386.778, 353.452, 387.305, 353.452, 388.594); bezierVertex(353.452, 389.883, 353.664, 390.411, 353.924, 389.766); bezierVertex(354.185, 389.122, 354.185, 388.067, 353.924, 387.422); endShape(); beginShape(); vertex(367.049, 386.485); bezierVertex(366.789, 385.84, 366.577, 386.368, 366.577, 387.657); bezierVertex(366.577, 388.946, 366.789, 389.473, 367.049, 388.829); bezierVertex(367.31, 388.184, 367.31, 387.129, 367.049, 386.485); endShape(); beginShape(); vertex(373.606, 384.592); bezierVertex(373.349, 383.957, 373.155, 384.704, 373.174, 386.251); bezierVertex(373.193, 387.797, 373.403, 388.317, 373.641, 387.405); bezierVertex(373.878, 386.492, 373.863, 385.227, 373.606, 384.592); endShape(); beginShape(); vertex(125.174, 378.985); bezierVertex(124.914, 378.34, 124.702, 378.868, 124.702, 380.157); bezierVertex(124.702, 381.446, 124.914, 381.973, 125.174, 381.329); bezierVertex(125.435, 380.684, 125.435, 379.629, 125.174, 378.985); endShape(); beginShape(); vertex(354.807, 374.786); bezierVertex(354.496, 374.474, 354.274, 375.028, 354.315, 376.016); bezierVertex(354.36, 377.108, 354.582, 377.33, 354.881, 376.583); bezierVertex(355.152, 375.906, 355.119, 375.097, 354.807, 374.786); endShape(); beginShape(); vertex(367.987, 374.297); bezierVertex(367.727, 373.653, 367.514, 374.18, 367.514, 375.469); bezierVertex(367.514, 376.758, 367.727, 377.286, 367.987, 376.641); bezierVertex(368.247, 375.997, 368.247, 374.942, 367.987, 374.297); endShape(); beginShape(); vertex(374.549, 374.297); bezierVertex(374.289, 373.653, 374.077, 374.18, 374.077, 375.469); bezierVertex(374.077, 376.758, 374.289, 377.286, 374.549, 376.641); bezierVertex(374.81, 375.997, 374.81, 374.942, 374.549, 374.297); endShape(); beginShape(); vertex(130.799, 368.672); bezierVertex(130.539, 368.028, 130.327, 368.555, 130.327, 369.844); bezierVertex(130.327, 371.133, 130.539, 371.661, 130.799, 371.016); bezierVertex(131.06, 370.372, 131.06, 369.317, 130.799, 368.672); endShape(); beginShape(); vertex(143.95, 367.266); bezierVertex(143.714, 366.364, 143.521, 367.102, 143.521, 368.907); bezierVertex(143.521, 370.712, 143.714, 371.45, 143.95, 370.547); bezierVertex(144.186, 369.645, 144.186, 368.169, 143.95, 367.266); endShape(); beginShape(); vertex(124.237, 367.735); bezierVertex(123.977, 367.09, 123.764, 367.618, 123.764, 368.907); bezierVertex(123.764, 370.196, 123.977, 370.723, 124.237, 370.079); bezierVertex(124.497, 369.434, 124.497, 368.379, 124.237, 367.735); endShape(); beginShape(); vertex(368.95, 362.579); bezierVertex(368.714, 361.676, 368.521, 362.415, 368.521, 364.219); bezierVertex(368.521, 366.024, 368.714, 366.762, 368.95, 365.86); bezierVertex(369.186, 364.958, 369.186, 363.481, 368.95, 362.579); endShape(); beginShape(); vertex(375.528, 358.36); bezierVertex(375.304, 357.2, 375.121, 358.149, 375.121, 360.469); bezierVertex(375.121, 362.79, 375.304, 363.739, 375.528, 362.579); bezierVertex(375.751, 361.419, 375.751, 359.52, 375.528, 358.36); endShape(); beginShape(); vertex(355.745, 360.723); bezierVertex(355.433, 360.412, 355.212, 360.965, 355.253, 361.954); bezierVertex(355.298, 363.046, 355.52, 363.268, 355.819, 362.52); bezierVertex(356.09, 361.843, 356.056, 361.035, 355.745, 360.723); endShape(); beginShape(); vertex(129.887, 354.141); bezierVertex(129.652, 353.239, 129.459, 353.977, 129.459, 355.782); bezierVertex(129.459, 357.587, 129.652, 358.325, 129.887, 357.422); bezierVertex(130.123, 356.52, 130.123, 355.044, 129.887, 354.141); endShape(); beginShape(); vertex(123.294, 350.842); bezierVertex(123.037, 350.207, 122.842, 350.954, 122.861, 352.501); bezierVertex(122.88, 354.047, 123.091, 354.567, 123.328, 353.655); bezierVertex(123.566, 352.742, 123.55, 351.477, 123.294, 350.842); endShape(); beginShape(); vertex(142.987, 350.86); bezierVertex(142.727, 350.215, 142.514, 350.743, 142.514, 352.032); bezierVertex(142.514, 353.321, 142.727, 353.848, 142.987, 353.204); bezierVertex(143.247, 352.559, 143.247, 351.504, 142.987, 350.86); endShape(); beginShape(); vertex(369.887, 344.766); bezierVertex(369.652, 343.864, 369.459, 344.602, 369.459, 346.407); bezierVertex(369.459, 348.211, 369.652, 348.95, 369.887, 348.047); bezierVertex(370.123, 347.145, 370.123, 345.668, 369.887, 344.766); endShape(); beginShape(); vertex(356.762, 341.954); bezierVertex(356.527, 341.051, 356.334, 341.79, 356.334, 343.594); bezierVertex(356.334, 345.399, 356.527, 346.137, 356.762, 345.235); bezierVertex(356.998, 344.333, 356.998, 342.856, 356.762, 341.954); endShape(); beginShape(); vertex(376.419, 341.467); bezierVertex(376.162, 340.832, 375.967, 341.579, 375.986, 343.126); bezierVertex(376.005, 344.672, 376.216, 345.192, 376.453, 344.28); bezierVertex(376.691, 343.367, 376.675, 342.102, 376.418, 341.467); endShape(); beginShape(); vertex(128.919, 336.78); bezierVertex(128.662, 336.145, 128.467, 336.891, 128.486, 338.438); bezierVertex(128.505, 339.985, 128.716, 340.504, 128.953, 339.592); bezierVertex(129.191, 338.68, 129.175, 337.414, 128.919, 336.78); endShape(); beginShape(); vertex(122.387, 333.516); bezierVertex(122.152, 332.614, 121.959, 333.352, 121.959, 335.157); bezierVertex(121.959, 336.961, 122.152, 337.7, 122.387, 336.797); bezierVertex(122.623, 335.895, 122.623, 334.419, 122.387, 333.516); endShape(); beginShape(); vertex(142.075, 332.579); bezierVertex(141.839, 331.676, 141.646, 332.415, 141.646, 334.219); bezierVertex(141.646, 336.024, 141.839, 336.762, 142.075, 335.86); bezierVertex(142.311, 334.958, 142.311, 333.481, 142.075, 332.579); endShape(); beginShape(); vertex(370.799, 328.36); bezierVertex(370.539, 327.715, 370.327, 328.243, 370.327, 329.532); bezierVertex(370.327, 330.821, 370.539, 331.348, 370.799, 330.704); bezierVertex(371.06, 330.059, 371.06, 329.004, 370.799, 328.36); endShape(); beginShape(); vertex(377.414, 323.217); bezierVertex(377.198, 321.792, 377.016, 322.735, 377.009, 325.313); bezierVertex(377.002, 327.891, 377.178, 329.057, 377.401, 327.904); bezierVertex(377.624, 326.751, 377.629, 324.642, 377.414, 323.217); endShape(); beginShape(); vertex(357.725, 318.516); bezierVertex(357.51, 317.098, 357.334, 318.258, 357.334, 321.094); bezierVertex(357.334, 323.93, 357.51, 325.09, 357.725, 323.672); bezierVertex(357.94, 322.254, 357.94, 319.934, 357.725, 318.516); endShape(); beginShape(); vertex(128.043, 309.589); bezierVertex(127.836, 307.925, 127.67, 309.516, 127.674, 313.126); bezierVertex(127.678, 316.735, 127.847, 318.097, 128.05, 316.152); bezierVertex(128.253, 314.206, 128.25, 311.253, 128.043, 309.589); endShape(); beginShape(); vertex(121.476, 306.342); bezierVertex(121.261, 304.917, 121.079, 305.86, 121.072, 308.438); bezierVertex(121.065, 311.016, 121.241, 312.182, 121.463, 311.029); bezierVertex(121.686, 309.876, 121.692, 307.767, 121.476, 306.342); endShape(); beginShape(); vertex(141.168, 293.652); bezierVertex(140.961, 291.987, 140.795, 293.579, 140.799, 297.188); bezierVertex(140.803, 300.797, 140.972, 302.159, 141.175, 300.214); bezierVertex(141.378, 298.269, 141.375, 295.316, 141.168, 293.652); endShape(); beginShape(); vertex(371.786, 292.249); bezierVertex(371.572, 290.841, 371.401, 292.219, 371.407, 295.313); bezierVertex(371.413, 298.407, 371.587, 299.559, 371.795, 297.874); bezierVertex(372.004, 296.189, 372, 293.658, 371.785, 292.249); endShape(); beginShape(); vertex(378.34, 288.985); bezierVertex(378.117, 287.825, 377.934, 288.774, 377.934, 291.094); bezierVertex(377.934, 293.415, 378.117, 294.364, 378.34, 293.204); bezierVertex(378.564, 292.044, 378.564, 290.145, 378.34, 288.985); endShape(); beginShape(); vertex(358.557, 284.786); bezierVertex(358.246, 284.474, 358.024, 285.028, 358.065, 286.016); bezierVertex(358.11, 287.108, 358.332, 287.33, 358.631, 286.583); bezierVertex(358.902, 285.906, 358.869, 285.097, 358.557, 284.786); endShape(); beginShape(); vertex(124.944, 277.735); bezierVertex(124.066, 269.711, 122.56, 265.406, 120.491, 265.008); bezierVertex(119.085, 264.737, 118.94, 264.99, 119.696, 266.401); bezierVertex(120.203, 267.35, 120.89, 270.235, 121.221, 272.813); bezierVertex(122.472, 282.548, 122.759, 283.594, 124.174, 283.594); bezierVertex(125.347, 283.594, 125.477, 282.61, 124.944, 277.735); endShape(); beginShape(); vertex(377.372, 275.86); bezierVertex(377.886, 271.606, 378.632, 267.387, 379.03, 266.485); bezierVertex(379.552, 265.303, 379.333, 264.844, 378.248, 264.844); bezierVertex(377.419, 264.844, 376.741, 265.604, 376.741, 266.532); bezierVertex(376.741, 267.46, 376.331, 268.629, 375.83, 269.13); bezierVertex(375.329, 269.631, 374.636, 273.091, 374.289, 276.818); bezierVertex(373.764, 282.464, 373.891, 283.594, 375.049, 283.594); bezierVertex(376.089, 283.594, 376.673, 281.649, 377.372, 275.86); endShape(); beginShape(); vertex(140.332, 272.579); bezierVertex(141.558, 262.829, 145.368, 245.22, 146.704, 243.134); bezierVertex(147.147, 242.442, 147.724, 235.969, 147.985, 228.751); vertex(148.46, 215.626); vertex(152.587, 215.157); bezierVertex(156.695, 214.69, 156.734, 214.651, 160.865, 206.735); bezierVertex(163.148, 202.362, 165.069, 198.067, 165.135, 197.191); bezierVertex(165.201, 196.316, 165.556, 195.785, 165.924, 196.012); bezierVertex(166.292, 196.24, 167.964, 193.996, 169.639, 191.026); bezierVertex(171.315, 188.056, 174.284, 183.516, 176.238, 180.938); bezierVertex(178.192, 178.36, 180.968, 174.639, 182.406, 172.669); bezierVertex(183.845, 170.699, 190.507, 163.379, 197.21, 156.402); bezierVertex(203.913, 149.424, 209.416, 143.231, 209.44, 142.639); bezierVertex(209.463, 142.047, 209.928, 141.647, 210.472, 141.751); bezierVertex(211.015, 141.854, 215.215, 139.101, 219.804, 135.633); bezierVertex(227.623, 129.723, 237.792, 123.004, 244.459, 119.341); vertex(247.366, 117.744); vertex(247.442, 64.497); bezierVertex(247.484, 35.212, 247.599, 10.181, 247.699, 8.875); vertex(247.879, 6.498); vertex(240.826, 10.351); bezierVertex(228.861, 16.886, 211.931, 27.89, 207.414, 32.067); bezierVertex(206.184, 33.204, 205.179, 33.91, 205.179, 33.635); bezierVertex(205.179, 33.361, 202.863, 35.115, 200.032, 37.534); bezierVertex(197.202, 39.952, 195.157, 42.37, 195.489, 42.907); bezierVertex(195.827, 43.453, 195.644, 43.606, 195.073, 43.254); bezierVertex(191.059, 40.773, 146.313, 92.875, 147.821, 98.273); bezierVertex(147.94, 98.698, 147.605, 98.779, 147.077, 98.452); bezierVertex(146.548, 98.126, 146.116, 98.305, 146.116, 98.851); bezierVertex(146.116, 100.53, 145.808, 101.19, 144.242, 102.871); bezierVertex(142.377, 104.873, 131.234, 127.184, 127.961, 135.469); bezierVertex(125.044, 142.852, 120.804, 156.071, 120.804, 157.779); bezierVertex(120.804, 158.476, 121.276, 158.725, 121.886, 158.349); bezierVertex(122.562, 157.931, 122.714, 158.092, 122.29, 158.777); bezierVertex(121.917, 159.381, 121.284, 159.672, 120.883, 159.425); bezierVertex(119.304, 158.449, 115.377, 176.416, 112.799, 196.407); bezierVertex(111.19, 208.883, 110.892, 240.619, 112.333, 245.97); bezierVertex(112.868, 247.957, 114.911, 251.434, 116.874, 253.698); bezierVertex(124.178, 262.12, 126.436, 266.121, 127.674, 272.828); vertex(128.871, 279.31); vertex(133.04, 280.423); bezierVertex(135.333, 281.035, 137.654, 281.577, 138.197, 281.627); bezierVertex(138.757, 281.679, 139.68, 277.765, 140.332, 272.579); endShape(); beginShape(); vertex(365.904, 280.262); bezierVertex(369.959, 279.501, 370.049, 279.37, 371.138, 272.675); bezierVertex(372.018, 267.269, 373.325, 264.93, 380.927, 255.149); bezierVertex(383.268, 252.137, 384.965, 249.319, 384.697, 248.886); bezierVertex(384.429, 248.453, 384.646, 247.83, 385.179, 247.501); bezierVertex(385.711, 247.171, 385.864, 246.444, 385.518, 245.885); bezierVertex(385.159, 245.305, 385.322, 245.135, 385.896, 245.489); bezierVertex(387.538, 246.504, 388.314, 234.853, 387.698, 218.438); bezierVertex(387.118, 202.989, 385.407, 187.818, 382.878, 175.685); bezierVertex(380.702, 165.25, 375.677, 147.625, 374.996, 148.043); bezierVertex(374.667, 148.246, 374.308, 147.18, 374.199, 145.675); bezierVertex(374.091, 144.169, 373.395, 141.574, 372.653, 139.907); bezierVertex(371.911, 138.24, 369.736, 132.999, 367.819, 128.262); bezierVertex(365.903, 123.525, 363.725, 119.414, 362.979, 119.128); bezierVertex(362.233, 118.842, 361.874, 118.2, 362.182, 117.702); bezierVertex(362.728, 116.818, 356.541, 105.2, 349.697, 94.258); bezierVertex(346.031, 88.397, 335.003, 73.623, 329.77, 67.56); bezierVertex(324.661, 61.642, 306.929, 44.437, 301.205, 39.844); bezierVertex(298.313, 37.524, 294.988, 34.782, 293.817, 33.751); bezierVertex(292.646, 32.719, 291.059, 31.454, 290.292, 30.938); bezierVertex(288.744, 29.898, 281.668, 24.697, 278.816, 22.503); bezierVertex(277.809, 21.728, 276.503, 21.094, 275.914, 21.094); bezierVertex(275.326, 21.094, 274.071, 20.24, 273.127, 19.196); bezierVertex(272.182, 18.153, 270.983, 17.441, 270.462, 17.614); bezierVertex(269.941, 17.788, 268.734, 17.15, 267.781, 16.197); bezierVertex(266.828, 15.243, 265.641, 14.715, 265.144, 15.022); bezierVertex(264.648, 15.329, 264.241, 15.192, 264.241, 14.718); bezierVertex(264.241, 14.046, 255.93, 9.007, 251.822, 7.188); bezierVertex(251.434, 7.016, 251.116, 31.756, 251.116, 62.166); bezierVertex(251.116, 113.925, 251.221, 117.502, 252.757, 118.174); bezierVertex(253.659, 118.569, 254.714, 118.825, 255.1, 118.743); bezierVertex(255.487, 118.661, 255.804, 118.993, 255.804, 119.481); bezierVertex(255.804, 120.356, 259.411, 122.667, 262.6, 123.837); bezierVertex(263.503, 124.167, 264.241, 124.836, 264.241, 125.321); bezierVertex(264.241, 125.807, 264.666, 125.942, 265.185, 125.621); bezierVertex(265.704, 125.301, 266.382, 125.697, 266.692, 126.504); bezierVertex(267.001, 127.31, 267.626, 127.969, 268.081, 127.969); bezierVertex(269.522, 127.969, 283.846, 139.073, 290.64, 145.456); bezierVertex(292.01, 146.744, 293.909, 147.927, 294.858, 148.086); bezierVertex(295.808, 148.245, 296.502, 148.777, 296.401, 149.269); bezierVertex(296.074, 150.867, 301.667, 156.248, 302.911, 155.531); bezierVertex(303.557, 155.16, 303.78, 155.193, 303.408, 155.605); bezierVertex(302.748, 156.336, 304.512, 158.782, 310.52, 165.469); bezierVertex(312.141, 167.274, 314.099, 169.659, 314.87, 170.768); bezierVertex(315.641, 171.878, 318.189, 175.253, 320.531, 178.268); bezierVertex(325.768, 185.009, 336.613, 202.908, 339.727, 209.949); bezierVertex(342.019, 215.131, 342.05, 215.157, 346.16, 215.157); bezierVertex(349.062, 215.157, 350.46, 215.598, 350.86, 216.64); bezierVertex(351.172, 217.455, 351.429, 223.178, 351.429, 229.358); bezierVertex(351.429, 235.537, 351.821, 241.326, 352.301, 242.223); bezierVertex(353.231, 243.96, 358.466, 269.754, 359.429, 277.34); bezierVertex(359.844, 280.617, 360.354, 281.733, 361.274, 281.38); bezierVertex(361.973, 281.111, 364.057, 280.608, 365.904, 280.262); endShape(); beginShape(); vertex(371.292, 281.079); bezierVertex(370.615, 280.808, 369.806, 280.841, 369.495, 281.153); bezierVertex(369.183, 281.464, 369.737, 281.686, 370.725, 281.645); bezierVertex(371.818, 281.6, 372.04, 281.378, 371.292, 281.079); endShape(); beginShape(); vertex(120.432, 278.223); bezierVertex(120.121, 277.912, 119.899, 278.465, 119.94, 279.454); bezierVertex(119.985, 280.546, 120.207, 280.768, 120.506, 280.02); bezierVertex(120.777, 279.343, 120.744, 278.535, 120.432, 278.223); endShape(); beginShape(); vertex(379.237, 273.047); bezierVertex(378.977, 272.403, 378.764, 272.93, 378.764, 274.219); bezierVertex(378.764, 275.508, 378.977, 276.036, 379.237, 275.391); bezierVertex(379.497, 274.747, 379.497, 273.692, 379.237, 273.047); endShape(); beginShape(); vertex(141.995, 272.598); bezierVertex(141.683, 272.287, 141.462, 272.84, 141.503, 273.829); bezierVertex(141.548, 274.921, 141.77, 275.143, 142.069, 274.395); bezierVertex(142.34, 273.718, 142.306, 272.91, 141.995, 272.598); endShape(); beginShape(); vertex(383.304, 263.438); bezierVertex(383.945, 262.665, 384.26, 262.032, 384.002, 262.032); bezierVertex(383.744, 262.032, 383.008, 262.665, 382.366, 263.438); bezierVertex(381.724, 264.211, 381.41, 264.844, 381.668, 264.844); bezierVertex(381.926, 264.844, 382.662, 264.211, 383.304, 263.438); endShape(); beginShape(); vertex(117.433, 259.922); bezierVertex(113.66, 255.466, 111.381, 253.329, 110.908, 253.803); bezierVertex(110.267, 254.443, 117.075, 262.032, 118.29, 262.032); bezierVertex(118.801, 262.032, 118.415, 261.083, 117.433, 259.922); endShape(); beginShape(); vertex(385.962, 257.093); bezierVertex(386.139, 256.697, 386.909, 255.748, 387.673, 254.984); bezierVertex(388.437, 254.22, 388.689, 253.594, 388.233, 253.594); bezierVertex(387.377, 253.594, 383.744, 257.337, 381.41, 260.626); bezierVertex(380.397, 262.052, 380.744, 261.94, 382.86, 260.157); bezierVertex(384.39, 258.868, 385.786, 257.489, 385.962, 257.093); endShape(); beginShape(); vertex(110.667, 252.016); bezierVertex(109.99, 251.746, 109.181, 251.779, 108.87, 252.09); bezierVertex(108.558, 252.402, 109.112, 252.623, 110.1, 252.583); bezierVertex(111.193, 252.538, 111.415, 252.316, 110.667, 252.016); endShape(); beginShape(); vertex(389.104, 252.016); bezierVertex(388.428, 251.746, 387.619, 251.779, 387.307, 252.09); bezierVertex(386.996, 252.402, 387.55, 252.623, 388.538, 252.583); bezierVertex(389.63, 252.538, 389.852, 252.316, 389.104, 252.016); endShape(); beginShape(); vertex(109.587, 248.968); bezierVertex(109.053, 247.971, 108.616, 246.284, 108.616, 245.218); bezierVertex(108.616, 243.943, 108.01, 243.282, 106.841, 243.282); bezierVertex(105.236, 243.282, 105.157, 243.642, 106.017, 247.032); bezierVertex(106.712, 249.769, 107.454, 250.782, 108.763, 250.782); bezierVertex(110.246, 250.782, 110.389, 250.468, 109.587, 248.968); endShape(); beginShape(); vertex(392.49, 247.668); bezierVertex(393.926, 243.698, 393.905, 243.282, 392.273, 243.282); bezierVertex(391.534, 243.282, 390.69, 244.169, 390.397, 245.252); bezierVertex(390.104, 246.336, 389.626, 248.024, 389.333, 249.002); bezierVertex(388.381, 252.192, 391.301, 250.958, 392.49, 247.668); endShape(); beginShape(); vertex(149.342, 244.36); bezierVertex(148.542, 243.45, 147.215, 245.423, 147.727, 246.759); bezierVertex(148.247, 248.115, 148.398, 248.083, 148.975, 246.495); bezierVertex(149.336, 245.501, 149.501, 244.54, 149.342, 244.36); endShape(); beginShape(); vertex(350.819, 243.721); bezierVertex(350.075, 241.783, 349.554, 242.011, 349.554, 244.275); bezierVertex(349.554, 245.336, 349.957, 245.956, 350.45, 245.651); bezierVertex(350.943, 245.346, 351.109, 244.477, 350.819, 243.721); endShape(); beginShape(); vertex(103.612, 241.172); bezierVertex(103.352, 240.528, 103.139, 241.055, 103.139, 242.344); bezierVertex(103.139, 243.633, 103.352, 244.161, 103.612, 243.516); bezierVertex(103.872, 242.872, 103.872, 241.817, 103.612, 241.172); endShape(); beginShape(); vertex(107.679, 225.569); bezierVertex(107.679, 190.894, 113.481, 161.831, 126.977, 128.907); bezierVertex(129.444, 122.889, 141.407, 99.658, 142.948, 97.896); bezierVertex(143.659, 97.081, 144.241, 95.921, 144.241, 95.317); bezierVertex(144.241, 94.713, 144.698, 94.219, 145.257, 94.219); bezierVertex(145.815, 94.219, 146.115, 93.747, 145.923, 93.17); bezierVertex(145.73, 92.593, 146.762, 90.847, 148.216, 89.291); bezierVertex(149.669, 87.735, 150.657, 86.26, 150.41, 86.014); bezierVertex(150.164, 85.767, 150.994, 84.454, 152.255, 83.095); bezierVertex(153.517, 81.737, 156.525, 78.094, 158.941, 75.001); bezierVertex(161.357, 71.907, 165.155, 67.39, 167.381, 64.963); bezierVertex(171.594, 60.369, 172.199, 59.007, 170.304, 58.376); bezierVertex(169.613, 58.145, 169.812, 57.758, 170.822, 57.371); bezierVertex(171.971, 56.93, 172.263, 57.089, 171.795, 57.902); bezierVertex(170.913, 59.434, 175.527, 55.456, 180.804, 50.135); bezierVertex(183.124, 47.795, 187.026, 44.261, 189.475, 42.281); bezierVertex(191.925, 40.301, 193.929, 38.074, 193.929, 37.332); bezierVertex(193.929, 36.591, 194.372, 36.258, 194.914, 36.593); bezierVertex(195.456, 36.928, 196.863, 36.214, 198.041, 35.008); bezierVertex(201.647, 31.311, 211.951, 23.68, 219.925, 18.801); bezierVertex(223.362, 16.697, 225.518, 14.795, 225.165, 14.176); bezierVertex(224.835, 13.598, 224.898, 13.425, 225.303, 13.791); bezierVertex(225.979, 14.401, 231.258, 12.23, 232.371, 10.885); bezierVertex(233.297, 9.767, 248.173, 2.344, 249.489, 2.344); bezierVertex(251.085, 2.344, 256.244, 4.783, 259.659, 7.152); bezierVertex(262.384, 9.042, 263.929, 8.467, 262.124, 6.235); bezierVertex(261.159, 5.043, 261.201, 4.932, 262.366, 5.584); bezierVertex(263.14, 6.016, 262.884, 5.504, 261.798, 4.446); bezierVertex(260.712, 3.388, 257.408, 1.418, 254.457, 0.068); vertex(249.09, -2.387); vertex(239.82, 2.46); bezierVertex(234.702, 5.137, 230.812, 7.731, 231.135, 8.252); bezierVertex(231.456, 8.772, 231.262, 8.914, 230.704, 8.57); bezierVertex(229.186, 7.631, 205.917, 22.879, 196.838, 30.762); bezierVertex(194.351, 32.921, 189.7, 36.951, 186.501, 39.717); bezierVertex(182.844, 42.88, 180.876, 45.243, 181.198, 46.083); bezierVertex(181.504, 46.881, 181.209, 47.31, 180.465, 47.148); bezierVertex(178.521, 46.723, 168.291, 56.708, 160.647, 66.492); bezierVertex(159.1, 68.472, 156.631, 71.513, 155.16, 73.249); bezierVertex(153.688, 74.986, 152.739, 76.407, 153.05, 76.407); bezierVertex(153.361, 76.407, 152.878, 77.22, 151.975, 78.215); bezierVertex(147.526, 83.117, 144.128, 88.59, 144.828, 89.723); bezierVertex(145.097, 90.159, 144.854, 90.4, 144.287, 90.258); bezierVertex(143.72, 90.117, 142.528, 91.266, 141.639, 92.813); bezierVertex(140.75, 94.36, 139.706, 95.766, 139.319, 95.938); bezierVertex(138.932, 96.11, 138.616, 96.72, 138.616, 97.294); bezierVertex(138.616, 97.868, 137.529, 99.905, 136.201, 101.822); bezierVertex(134.873, 103.738, 133.698, 105.912, 133.589, 106.653); bezierVertex(133.48, 107.394, 132.742, 109.013, 131.949, 110.25); bezierVertex(129.727, 113.719, 122.679, 128.871, 122.679, 130.18); bezierVertex(122.679, 130.82, 122.325, 131.745, 121.894, 132.235); bezierVertex(119.062, 135.448, 110.766, 165.188, 107.718, 183.053); bezierVertex(104.065, 204.461, 103.254, 239.532, 106.412, 239.532); bezierVertex(107.419, 239.532, 107.679, 236.673, 107.679, 225.569); endShape(); beginShape(); vertex(389.59, 233.672); bezierVertex(389.367, 232.512, 389.184, 233.462, 389.184, 235.782); bezierVertex(389.184, 238.102, 389.367, 239.051, 389.59, 237.891); bezierVertex(389.814, 236.731, 389.814, 234.833, 389.59, 233.672); endShape(); beginShape(); vertex(394.554, 224.569); bezierVertex(394.554, 201.524, 392.714, 186.606, 386.891, 162.437); bezierVertex(385.08, 154.919, 383.651, 150.724, 383.031, 151.106); bezierVertex(382.421, 151.484, 382.276, 151.119, 382.649, 150.146); bezierVertex(382.98, 149.284, 382.776, 147.422, 382.196, 146.008); bezierVertex(381.616, 144.595, 380.997, 142.69, 380.819, 141.775); bezierVertex(380.641, 140.86, 379.41, 137.485, 378.082, 134.275); bezierVertex(376.754, 131.065, 375.175, 127.172, 374.573, 125.626); bezierVertex(372.94, 121.429, 360.812, 97.716, 359.469, 96.094); bezierVertex(358.828, 95.321, 356.92, 92.368, 355.229, 89.532); bezierVertex(348.302, 77.916, 328.048, 53.115, 325.963, 53.696); bezierVertex(325.455, 53.837, 325.29, 53.547, 325.597, 53.05); bezierVertex(325.904, 52.554, 324.187, 50.645, 321.782, 48.808); bezierVertex(319.377, 46.972, 317.755, 45.469, 318.178, 45.469); bezierVertex(319.143, 45.469, 309.897, 36.725, 305.491, 33.469); bezierVertex(303.686, 32.136, 301.788, 30.599, 301.272, 30.054); bezierVertex(299.227, 27.893, 293.501, 24.013, 292.951, 24.416); bezierVertex(292.629, 24.652, 292.564, 24.576, 292.806, 24.248); bezierVertex(293.224, 23.682, 276.166, 11.719, 274.94, 11.719); bezierVertex(274.619, 11.719, 272.608, 10.542, 270.471, 9.102); bezierVertex(263.817, 4.621, 263.889, 4.647, 264.475, 6.887); bezierVertex(264.766, 7.999, 264.621, 8.673, 264.154, 8.384); bezierVertex(263.686, 8.095, 263.304, 8.264, 263.304, 8.76); bezierVertex(263.304, 9.955, 268.875, 11.863, 270.119, 11.095); bezierVertex(270.67, 10.754, 270.814, 10.944, 270.45, 11.533); bezierVertex(270.088, 12.119, 270.948, 13.308, 272.414, 14.249); bezierVertex(273.849, 15.17, 275.84, 16.665, 276.84, 17.571); bezierVertex(277.839, 18.478, 279.064, 19.219, 279.56, 19.219); bezierVertex(280.057, 19.219, 282.311, 20.59, 284.569, 22.266); bezierVertex(300.046, 33.752, 305.413, 38.204, 314.297, 46.929); bezierVertex(319.813, 52.345, 324.729, 56.528, 325.221, 56.224); bezierVertex(325.713, 55.92, 326.116, 56.312, 326.116, 57.095); bezierVertex(326.116, 57.877, 327.276, 59.804, 328.694, 61.375); bezierVertex(333.778, 67.009, 336.924, 70.665, 338.539, 72.815); bezierVertex(357.528, 98.095, 367.7, 116.462, 377.392, 142.969); bezierVertex(381.286, 153.617, 381.608, 154.717, 384.523, 167.344); bezierVertex(389.431, 188.599, 390.936, 201.252, 391.126, 222.891); bezierVertex(391.259, 238.058, 391.418, 239.531, 392.913, 239.532); bezierVertex(394.407, 239.532, 394.554, 238.194, 394.554, 224.569); endShape(); beginShape(); vertex(396.106, 235.53); bezierVertex(395.849, 234.895, 395.655, 235.641, 395.674, 237.188); bezierVertex(395.693, 238.735, 395.903, 239.254, 396.141, 238.342); bezierVertex(396.378, 237.43, 396.363, 236.164, 396.106, 235.53); endShape(); beginShape(); vertex(102.737, 221.016); bezierVertex(102.534, 219.083, 102.369, 220.665, 102.369, 224.532); bezierVertex(102.369, 228.399, 102.534, 229.981, 102.737, 228.047); bezierVertex(102.939, 226.114, 102.939, 222.95, 102.737, 221.016); endShape(); beginShape(); vertex(109.237, 223.36); bezierVertex(108.977, 222.715, 108.764, 223.243, 108.764, 224.532); bezierVertex(108.764, 225.821, 108.977, 226.348, 109.237, 225.704); bezierVertex(109.497, 225.059, 109.497, 224.005, 109.237, 223.36); endShape(); beginShape(); vertex(346.753, 217.942); bezierVertex(347.629, 217.388, 313.058, 217.055, 253.694, 217.046); bezierVertex(164.411, 217.033, 159.235, 216.942, 159.132, 215.391); bezierVertex(159.029, 213.829, 159.003, 213.829, 158.595, 215.391); bezierVertex(158.29, 216.558, 157.222, 217.032, 154.898, 217.032); bezierVertex(152.943, 217.032, 151.865, 217.411, 152.214, 217.976); bezierVertex(152.985, 219.224, 344.779, 219.19, 346.753, 217.942); endShape(); beginShape(); vertex(389.59, 212.11); bezierVertex(389.367, 210.95, 389.184, 211.899, 389.184, 214.219); bezierVertex(389.184, 216.54, 389.367, 217.489, 389.59, 216.329); bezierVertex(389.814, 215.169, 389.814, 213.27, 389.59, 212.11); endShape(); beginShape(); vertex(337.366, 213.971); bezierVertex(337.366, 213.319, 336.46, 211.104, 335.352, 209.049); bezierVertex(334.244, 206.994, 332.161, 203.055, 330.723, 200.295); bezierVertex(329.284, 197.535, 327.516, 194.582, 326.792, 193.733); bezierVertex(326.068, 192.883, 323.899, 189.547, 321.972, 186.319); bezierVertex(319.938, 182.911, 318.046, 180.711, 317.46, 181.073); bezierVertex(316.859, 181.444, 316.724, 181.256, 317.124, 180.608); bezierVertex(317.501, 179.998, 317.152, 179.271, 316.332, 178.956); bezierVertex(315.526, 178.647, 314.866, 177.802, 314.866, 177.08); bezierVertex(314.866, 176.357, 313.706, 174.427, 312.288, 172.792); bezierVertex(298.307, 156.663, 287.082, 145.665, 277.98, 139.176); bezierVertex(275.482, 137.395, 272.649, 135.214, 271.684, 134.329); bezierVertex(268.204, 131.138, 262.417, 128.009, 261, 128.552); bezierVertex(260.137, 128.883, 259.547, 128.594, 259.537, 127.835); bezierVertex(259.528, 127.136, 257.413, 125.185, 254.837, 123.501); vertex(250.154, 120.439); vertex(244.307, 123.627); bezierVertex(233.406, 129.57, 213.616, 143.908, 213.616, 145.863); bezierVertex(213.616, 146.334, 213.089, 146.614, 212.444, 146.485); bezierVertex(211.8, 146.356, 211.378, 146.778, 211.507, 147.422); bezierVertex(211.636, 148.067, 211.214, 148.489, 210.569, 148.36); bezierVertex(209.925, 148.231, 209.455, 148.859, 209.526, 149.756); bezierVertex(209.597, 150.653, 209.238, 151.129, 208.728, 150.814); bezierVertex(207.521, 150.068, 195.718, 161.76, 196.462, 162.964); bezierVertex(196.805, 163.518, 196.537, 163.579, 195.789, 163.117); bezierVertex(194.88, 162.555, 194.713, 162.78, 195.165, 163.958); bezierVertex(195.522, 164.889, 195.402, 165.332, 194.88, 165.009); bezierVertex(194.384, 164.703, 193.229, 165.369, 192.313, 166.49); bezierVertex(191.397, 167.611, 188.595, 170.898, 186.087, 173.795); bezierVertex(183.579, 176.693, 181.086, 180.012, 180.546, 181.172); bezierVertex(180.007, 182.333, 179.211, 183.282, 178.778, 183.282); bezierVertex(178.345, 183.282, 177.991, 183.915, 177.991, 184.688); bezierVertex(177.991, 185.462, 177.569, 186.094, 177.054, 186.094); bezierVertex(176.538, 186.094, 176.116, 186.525, 176.116, 187.05); bezierVertex(176.116, 187.576, 174.956, 189.749, 173.538, 191.878); bezierVertex(168.813, 198.974, 161.116, 212.79, 161.116, 214.176); bezierVertex(161.116, 214.852, 188.501, 215.157, 249.241, 215.157); bezierVertex(319.666, 215.157, 337.366, 214.919, 337.366, 213.971); endShape(); beginShape(); vertex(396.164, 206.967); bezierVertex(395.948, 205.542, 395.766, 206.485, 395.759, 209.063); bezierVertex(395.752, 211.641, 395.928, 212.807, 396.151, 211.654); bezierVertex(396.374, 210.501, 396.379, 208.392, 396.164, 206.967); endShape(); beginShape(); vertex(110.12, 204.161); bezierVertex(109.808, 203.849, 109.587, 204.403, 109.628, 205.391); bezierVertex(109.673, 206.483, 109.895, 206.705, 110.194, 205.958); bezierVertex(110.465, 205.281, 110.431, 204.472, 110.12, 204.161); endShape(); beginShape(); vertex(388.612, 199.922); bezierVertex(388.352, 199.278, 388.139, 199.805, 388.139, 201.094); bezierVertex(388.139, 202.383, 388.352, 202.911, 388.612, 202.266); bezierVertex(388.872, 201.622, 388.872, 200.567, 388.612, 199.922); endShape(); beginShape(); vertex(104.495, 191.973); bezierVertex(104.183, 191.662, 103.962, 192.215, 104.003, 193.204); bezierVertex(104.048, 194.296, 104.27, 194.518, 104.569, 193.77); bezierVertex(104.84, 193.093, 104.806, 192.285, 104.495, 191.973); endShape(); beginShape(); vertex(394.182, 188.223); bezierVertex(393.871, 187.912, 393.649, 188.465, 393.69, 189.454); bezierVertex(393.735, 190.546, 393.957, 190.768, 394.256, 190.02); bezierVertex(394.527, 189.343, 394.494, 188.535, 394.182, 188.223); endShape(); beginShape(); vertex(207.991, 148.126); bezierVertex(208.633, 147.352, 208.947, 146.719, 208.689, 146.719); bezierVertex(208.432, 146.719, 207.695, 147.352, 207.054, 148.126); bezierVertex(206.412, 148.899, 206.097, 149.532, 206.355, 149.532); bezierVertex(206.613, 149.532, 207.349, 148.899, 207.991, 148.126); endShape(); beginShape(); vertex(215.022, 142.032); bezierVertex(215.956, 141.001, 216.508, 140.157, 216.25, 140.157); bezierVertex(215.993, 140.157, 215.018, 141.001, 214.085, 142.032); bezierVertex(213.152, 143.063, 212.599, 143.907, 212.857, 143.907); bezierVertex(213.115, 143.907, 214.089, 143.063, 215.022, 142.032); endShape(); beginShape(); vertex(328.929, 52.615); bezierVertex(328.929, 52.421, 328.19, 51.682, 327.288, 50.975); bezierVertex(325.801, 49.809, 325.768, 49.842, 326.934, 51.329); bezierVertex(328.159, 52.89, 328.929, 53.387, 328.929, 52.615); endShape(); beginShape(); vertex(185.491, 38.438); bezierVertex(186.133, 37.665, 186.447, 37.032, 186.189, 37.032); bezierVertex(185.932, 37.032, 185.195, 37.665, 184.554, 38.438); bezierVertex(183.912, 39.212, 183.597, 39.844, 183.855, 39.844); bezierVertex(184.113, 39.844, 184.849, 39.212, 185.491, 38.438); endShape(); popMatrix(); } void serialEvent(Serial port) { interval = millis(); while (port.available() > 0) { int ch = port.read(); print((char)ch); if (ch == '$') {serialCount = 0;} // this will help with alignment if (aligned < 4) { // make sure we are properly aligned on a 14-byte packet if (serialCount == 0) { if (ch == '$') aligned++; else aligned = 0; } else if (serialCount == 1) { if (ch == 2) aligned++; else aligned = 0; } else if (serialCount == 12) { if (ch == '\r') aligned++; else aligned = 0; } else if (serialCount == 13) { if (ch == '\n') aligned++; else aligned = 0; } //println(ch + " " + aligned + " " + serialCount); serialCount++; if (serialCount == 14) serialCount = 0; } else { if (serialCount > 0 || ch == '$') { teapotPacket[serialCount++] = (char)ch; if (serialCount == 14) { serialCount = 0; // restart packet byte position // get quaternion from data packet q[0] = ((teapotPacket[2] << 8) | teapotPacket[3]) / 16384.0f; q[1] = ((teapotPacket[4] << 8) | teapotPacket[5]) / 16384.0f; q[2] = ((teapotPacket[6] << 8) | teapotPacket[7]) / 16384.0f; q[3] = ((teapotPacket[8] << 8) | teapotPacket[9]) / 16384.0f; for (int i = 0; i < 4; i++) if (q[i] >= 2) q[i] = -4 + q[i]; // set our toxilibs quaternion to new data quat.set(q[0], q[1], q[2], q[3]); /* // below calculations unnecessary for orientation only using toxilibs // calculate gravity vector gravity[0] = 2 * (q[1]*q[3] - q[0]*q[2]); gravity[1] = 2 * (q[0]*q[1] + q[2]*q[3]); gravity[2] = q[0]*q[0] - q[1]*q[1] - q[2]*q[2] + q[3]*q[3]; // calculate Euler angles euler[0] = atan2(2*q[1]*q[2] - 2*q[0]*q[3], 2*q[0]*q[0] + 2*q[1]*q[1] - 1); euler[1] = -asin(2*q[1]*q[3] + 2*q[0]*q[2]); euler[2] = atan2(2*q[2]*q[3] - 2*q[0]*q[1], 2*q[0]*q[0] + 2*q[3]*q[3] - 1); // calculate yaw/pitch/roll angles ypr[0] = atan2(2*q[1]*q[2] - 2*q[0]*q[3], 2*q[0]*q[0] + 2*q[1]*q[1] - 1); ypr[1] = atan(gravity[0] / sqrt(gravity[1]*gravity[1] + gravity[2]*gravity[2])); ypr[2] = atan(gravity[1] / sqrt(gravity[0]*gravity[0] + gravity[2]*gravity[2])); // output various components for debugging //println("q:\t" + round(q[0]*100.0f)/100.0f + "\t" + round(q[1]*100.0f)/100.0f + "\t" + round(q[2]*100.0f)/100.0f + "\t" + round(q[3]*100.0f)/100.0f); //println("euler:\t" + euler[0]*180.0f/PI + "\t" + euler[1]*180.0f/PI + "\t" + euler[2]*180.0f/PI); //println("ypr:\t" + ypr[0]*180.0f/PI + "\t" + ypr[1]*180.0f/PI + "\t" + ypr[2]*180.0f/PI); */ } } } } } void drawCylinder(float topRadius, float bottomRadius, float tall, int sides) { float angle = 0; float angleIncrement = TWO_PI / sides; beginShape(QUAD_STRIP); for (int i = 0; i < sides + 1; ++i) { vertex(topRadius*cos(angle), 0, topRadius*sin(angle)); vertex(bottomRadius*cos(angle), tall, bottomRadius*sin(angle)); angle += angleIncrement; } endShape(); // If it is not a cone, draw the circular top cap if (topRadius != 0) { angle = 0; beginShape(TRIANGLE_FAN); // Center point vertex(0, 0, 0); for (int i = 0; i < sides + 1; i++) { vertex(topRadius * cos(angle), 0, topRadius * sin(angle)); angle += angleIncrement; } endShape(); } // If it is not a cone, draw the circular bottom cap if (bottomRadius != 0) { angle = 0; beginShape(TRIANGLE_FAN); // Center point vertex(0, tall, 0); for (int i = 0; i < sides + 1; i++) { vertex(bottomRadius * cos(angle), tall, bottomRadius * sin(angle)); angle += angleIncrement; } endShape(); } }