Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ROTATE_ANGLE = 26;
- HAND_COUNT = 29;
- HAND_FRACTION = HAND_COUNT / count;
- DEG_TO_RAD = pi / 180;
- RING_SIZE = 65;
- INNER_RING_SIZE = 17;
- HAND_LENGTH = 110;
- #7 fractions
- #first 5: the star
- # next 2: the circle
- #first part of the star
- first_diff = (index + 1) / HAND_COUNT;
- is_first_hand = floor(index / HAND_COUNT) == 0;
- first_hand_x = (first_diff) * HAND_LENGTH * is_first_hand;
- first_hand_y = 0;
- #second part
- second_diff = (index - HAND_COUNT + 1) / HAND_COUNT;
- is_second_hand = floor(second_diff) == 0;
- second_hand_x = second_diff * HAND_LENGTH * is_second_hand;
- second_hand_y = 0;
- #third part
- third_diff = (index - HAND_COUNT * 2 + 1) / HAND_COUNT;
- is_third_hand = floor(third_diff) == 0;
- third_hand_x = third_diff * HAND_LENGTH * is_third_hand;
- third_hand_y = 0;
- #fourth part
- fourth_diff = (index - HAND_COUNT * 3 + 1) / HAND_COUNT;
- is_fourth_hand = floor(fourth_diff) == 0;
- fourth_hand_x = fourth_diff * HAND_LENGTH * is_fourth_hand;
- fourth_hand_y = 0;
- #fifth part
- fifth_diff = (index - HAND_COUNT * 4 + 1) / HAND_COUNT;
- is_fifth_hand = floor(fifth_diff) == 0;
- fifth_hand_x = fifth_diff * HAND_LENGTH * is_fifth_hand;
- fifth_hand_y = 0;
- #sixth part
- sixth_diff = (index - HAND_COUNT * 5 + 1) / HAND_COUNT;
- is_sixth_hand = floor(sixth_diff) == 0;
- sixth_hand_x = sixth_diff * HAND_LENGTH * is_sixth_hand;
- sixth_hand_y = 0;
- #rotate first hand
- cos1 = cos(-60 * DEG_TO_RAD);
- sin1 = sin(-60 * DEG_TO_RAD);
- x1 = first_hand_x * cos1 - first_hand_y * sin1;
- y1 = first_hand_y * cos1 + first_hand_x * sin1;
- #rotate second hand
- cos2 = cos(-120 * DEG_TO_RAD);
- sin2 = sin(-120 * DEG_TO_RAD);
- x2 = second_hand_x * cos2 - second_hand_y * sin2;
- y2 = second_hand_y * cos2 + second_hand_x * sin2;
- #rotate third hand
- sqrt3 = sqrt(3);
- sqrt3_length = sqrt(3) * 0.5 * HAND_LENGTH;
- one_half = HAND_LENGTH * 0.5;
- x3 = third_hand_x - is_third_hand * one_half;
- y3 = third_hand_y - is_third_hand * sqrt3_length;
- #just mirror according to the y axis when ur done
- #rotate fourth hand
- #direct translate
- x4 = fourth_hand_x * cos1 - fourth_hand_y * sin1;
- y4 = fourth_hand_y * cos1 + fourth_hand_x * sin1;
- #rotate fifth hand
- x5 = fifth_hand_x * cos2 - fifth_hand_y * sin2;
- y5 = fifth_hand_y * cos2 + fifth_hand_x * sin2;
- #sixth hand
- x6 = sixth_hand_x - is_sixth_hand * one_half;
- y6 = sixth_hand_y - is_sixth_hand * sqrt3_length;
- px = x1 + x2 + x3 + x4 + x5 + x6;
- py = y1 + y2 + y3;
- ny = y4 + y5 + y6;
- is_downface = is_fourth_hand | is_fifth_hand | is_sixth_hand;
- is_ring = index >= HAND_COUNT * 6;
- is_star = !is_ring;
- ring_f = (index - HAND_COUNT * 6) / (count - HAND_COUNT * 6)
- sub_index = index % 2;
- actual_ring_size = (RING_SIZE - sub_index * INNER_RING_SIZE);
- ring_x = sin(ring_f * tau) * is_ring * actual_ring_size;
- ring_y = cos(ring_f * tau) * is_ring * actual_ring_size;
- star_x = px;
- star_y = py - ny - is_downface * HAND_LENGTH * sqrt3 * 2 / 3 + is_star * HAND_LENGTH / sqrt(3);
- cos_time = cos(time * 0.5);
- sin_time = sin(time * 0.5);
- ssx = star_x * cos_time - star_y * sin_time;
- ssy = star_y * cos_time + star_x * sin_time;
- rsx = ring_x * cos_time + ring_y * sin_time;
- rsy = ring_y * cos_time - ring_x * sin_time;
- x' = ssx + rsx;
- y' = ssy + rsy;
- h = 0;
- s = 0;
- v = 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement