CHAPTER 12

Hierarchical Structure


In this chapter we have explored the ways in which graphic compositions can usefully be broken down into hierarchies of elements and subsystems.

- Subsystems:

12.1 Pantheon

prog12_1.png

  1. void setup(){
  2. size(800,600);
  3. }
  4.  
  5. void draw(){
  6. pantheon(400,300,200);
  7. }
  8.  
  9. void pantheon(int x_square,int y_square,int side){
  10.  
  11. //Relate circle to square
  12. int x_circle = x_square;
  13. int y_circle = y_square;
  14. int diameter = 2*side;
  15.  
  16. //Draw circle
  17. ellipse(x_circle, y_circle, diameter, diameter);
  18. //Draw square
  19. rect(x_square, y_square, side, side);
  20. }

Comments

Leave a Reply



(Your email will not be publicly displayed.)


Captcha Code

Click the image to see another captcha.