The Task

We will practice our basic understanding of Procesing and polar coordinates. In class we build a simple star function. In this assignment you will produce a Processing program that will generate a series of random fading stars on a black backgound. We have covered in class all of the parts you need to know.

A k-pointed star is defined as we saw in class by using k points in a circle and connecting them as we go around the star in clockwise order skipping every s points. If we skip 0 points (s=0) then we draw a k sided polygon. If we skip 1 point then this is the way would normally draw a 5 pointed star for example. In class we built a function called star. star was defined:

void star(float posx, float posy, color c, int numPts, float size)

The Changes you need to Make

  1. ( 1 pt) Make a window that is 1000 by 800.
  2. ( 1 pt) Black background.
  3. ( 1 pt) Set the frame rate to half the normal frame rate.
  4. ( 4 pt) Create a star routine using the same drawing algorithm we used in class.
  5. ( 4 pt) Modify the parameter list to take these parameters in order: the position, color, size, number of points, and the number of points to skip as you go around the circle of points. For example, if the skip number is 0 then draw a polygon, if the skip number is 1 then skip over a point for each line drawn. So think carefully about how you compute the new point and old point using the algorithm we gave in class! Hint: Skipping 0 means you go to the next point in the circle. Note the parameters aren't all in the same order they were in class!
  6. ( 1 pt) Be sure things that are integer type are declared integer type in the parameter list and called with integers the function call.
  7. ( 5 pt) Every frame draw a star at a random location (center in the window), random color with full saturation and brightness, random size between 0 and upto 200, random number of sides between 3 and upto 12, and skipping between 0 and (number of sides)/2 - 1 points.
  8. ( 1 pt) Stroke weight should be 5.
  9. ( 2 pt) Use a semi-transparent black wash (fade) the screen to black with each frame of the movie. An alpha of 35 works well.

Here is a movie of the program running.


Save your results as a .pde file and submit the file to the bblearn page.