Last active
          March 18, 2020 20:44 
        
      - 
      
- 
        Save villares/229bae8e9b3db9431865eb278af594e2 to your computer and use it in GitHub Desktop. 
    Live de Processing modo Python em 18/03/2020
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Instruções para baixar o Processing e instalar o modo Python em abav.lugaralgum.com/material-aulas | |
| def setup(): | |
| """ executa no começo - isto aqui é um 'doc-string' """ | |
| size(500, 500) # tamanho do desenho - isto aqui é um comentário (meta-comentário?) | |
| # não vamos usar cores RGB, vamos usar HSB | |
| colorMode(HSB) # Matiz, Saturação e Brilho | |
| noStroke() # sem contorno nas formas | |
| def draw(): | |
| """ | |
| tudo que executa repetidas vezes (isso permite animações e interação) | |
| """ | |
| background(100) # fundo e limpeza da tela cinza | |
| tam = mouseX / 20. | |
| espaco = 1 + mouseY / 20. # o 1 é pra não ter divisão por zero | |
| linhas = int(height / espaco) | |
| colunas = int(width / espaco) | |
| for j in range(linhas): | |
| y = espaco / 2 + j * espaco | |
| for i in range(colunas): | |
| x = espaco / 2 + i * espaco | |
| ang = radians(x / 2. + y / 2. + frameCount) | |
| matiz = 128 + 128 * sin(ang) | |
| cor = color(matiz, 255, 255) | |
| fill(cor) | |
| ellipse(x, y, tam, tam) | |
      
      
  Author
  
  
        
      
            villares
  
      
      
      commented 
        Mar 18, 2020 
      
    
  

  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment