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 = 125;
- #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(first_diff) == 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;
- #rotate first hand
- cos1 = cos(-72 * DEG_TO_RAD);
- sin1 = sin(-72 * 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(144 * DEG_TO_RAD);
- sin2 = sin(144 * DEG_TO_RAD);
- #compute offset
- cos18 = cos(18 * DEG_TO_RAD) * HAND_LENGTH;
- sin18 = sin(18 * DEG_TO_RAD) * HAND_LENGTH;
- #offset in the x direction by sin18 * length
- #offset in y by cos18 * length
- x2 = second_hand_x * cos2 - second_hand_y * sin2 + sin18 * is_second_hand;
- y2 = second_hand_y * cos2 + second_hand_x * sin2 - cos18 * is_second_hand;
- #rotate third hand
- half_hand = HAND_LENGTH / 2;
- tan36 = tan(36 * DEG_TO_RAD);
- x3 = third_hand_x - is_third_hand * half_hand;
- y3 = third_hand_y - is_third_hand * half_hand * tan36;
- #just mirror according to the x 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 + sin18 * is_fifth_hand;
- y5 = fifth_hand_y * cos2 + fifth_hand_x * sin2 - cos18 * is_fifth_hand;
- px = x1 + x2 + x3 - x4 - x5;
- py = y1 + y2 + y3 + y4 + y5;
- is_downface = is_fourth_hand | is_fifth_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_offset = is_star * (HAND_LENGTH * 0.5) / cos(18 * DEG_TO_RAD);
- star_y = py + star_offset;
- 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