Then, once all the scanlines have been processed in the input image, the HGP then looks at all the resulting stars that have been identified and it has to figure out a few things about each of them before they can be streaked. The first thing the HGP determines is where the center of each identified star is as well as the star's diameter in pixels. The HGP must also determine in which directions the stars must streak off the HI as well as the exact polygonal shape of each star streak that's going to be painted on the HI.
The program determines the star's location by dividing the star's X and Y axis MBR's in half and placing the star at that location. The star's diameter is determined dividing the total number of white pixels in the star by the number of vertical scanlines the star takes up on the HI. The size of all stars is also under user control and the user can tell the program to override all star sizes and use a default star size instead. I chose to override star sizes in the my hyperspace image on the previous web page and use a default star size of 2 pixels for all the stars in the resulting image.
The next thing that must be determined is the direction that each star must streak off the HI. This is done by knowing where the hyperspace jump point location is on the HI as well as each star's center location. By knowing these two points for each star, you can project a parametric line through these two points for each star which will intersect one of the edges of the HI. The starting point of a star as well as its HI edge intersection forms a line segment that will specify the direction of each star streak. This line segment will form the basis upon which the anti-aliased polygon will be laid upon.
NOTE: The details in next paragraph are actually done after the animation step but were included here because this is one of the things that must be done to prepare the stars to be streaked.
The last thing that must be done before star streaking can begin is to determine the exact polygonal shape, i.e. a four point fat line, of the star streak that is to be laid on top of the directional line segment determined above. This is done by first determining the angle of the star streak with the horizontal X axis. Because of the orientation of each star streak, this calculation always results in the angle being between 0-90 degrees, i.e. quadrant 1. Once this angle is determined, some increment of 90 degrees is added to this angle to put the angle into the correct quadrant, i.e. 0 degrees is added to put the angle in quad 1, 90 degrees is added to put the angle in quad 2, 180 degrees is added to put the angle in quad 3, or 270 degrees is added to put the angle in quad 4. To this now quadrant corrected angle, 90 more degrees is added to this angle. This is the angle that will define the line segment that effectively forms the short end cap segments to close off the star streak polygon. It should be noted that the HGP has the ability to form star streak polygons that are fatter at the ends than they are at their start. It is at this point in the HGP that the thickness of the polygons start and endpoints are adjusted.