How to draw a star-shaped polygon?
-
i need the algorithm to draw a star-shaped polygon (and star-shaped regular polygon). I use Bresenham and DDA to draw a line. In addition : How to draw a line with a negative co-ordinate (such as draw a line from (-5,10) to (20,-6)) Thanks Ask More - Learn More JohnJone
-
i need the algorithm to draw a star-shaped polygon (and star-shaped regular polygon). I use Bresenham and DDA to draw a line. In addition : How to draw a line with a negative co-ordinate (such as draw a line from (-5,10) to (20,-6)) Thanks Ask More - Learn More JohnJone
Well, here is an approach that you can take. The first thing you do is start with a Point array. Decide on the number of points the star is going to have. The number of points the star has determines the angle between the points. Using trigonometry (sin and cos) calculate the position of the point. Alternate between near and far points. Continue calculate until your are done with the whole star. Once you have the list of points you can draw or fill. This posting is provided "AS IS" with no warranties, and confers no rights. Alex Korchemniy
-
Well, here is an approach that you can take. The first thing you do is start with a Point array. Decide on the number of points the star is going to have. The number of points the star has determines the angle between the points. Using trigonometry (sin and cos) calculate the position of the point. Alternate between near and far points. Continue calculate until your are done with the whole star. Once you have the list of points you can draw or fill. This posting is provided "AS IS" with no warranties, and confers no rights. Alex Korchemniy