Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. vitorcarvalho
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    vitorcarvalho

    @vitorcarvalho

    0
    Reputation
    2
    Posts
    3
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    vitorcarvalho Follow

    Best posts made by vitorcarvalho

    This user hasn't posted anything yet.

    Latest posts made by vitorcarvalho

    • RE: Tutorial Request: Delay Animation

      Thank you frederik and eduairet! It's nice to see your approach. I tried a few more times after submiting the topic and this is what I ended up with:

      CANVAS = 500
      MARGIN = 60
      CIRCLES = 10
      CSIZE = (CANVAS / CIRCLES) - (MARGIN / CIRCLES)
      FRAMES = 96
      ROWS = CIRCLES
      
      for frame in range(FRAMES):
          newPage(CANVAS, CANVAS)
          fill(0)
          rect(0, 0, CANVAS, CANVAS)
          frameDuration(1 / 24)
          translate(0, CSIZE / 2)
          fill(1)
          
          for row in range(ROWS):
              for circle in range(CIRCLES):
                  save()
                  translate(circle * CSIZE)
                  scale(sin(pi * frame / FRAMES + circle / CIRCLES), center=(CSIZE / 2 + MARGIN / 2, MARGIN / 2))
                  oval(MARGIN / 2, -CSIZE / 2 + MARGIN / 2, CSIZE, CSIZE)
                  restore()
              translate(0, CSIZE)
              
      saveImage("~/Desktop/circleTest.gif")
      

      The resulting .gif:
      circleTest.gif

      posted in Tutorials
      vitorcarvalho
      vitorcarvalho
    • Tutorial Request: Delay Animation

      I'm trying to learn DrawBot (and Python) and I'm having a hard time trying to replicate an animation I saw on Twitter. Here it is: https://tixy.land (it's the first one)

      Here is what I wrote so far:

      canvasSize = 500
      circleCount = 10
      circleSize = canvasSize / circleCount
      offset = circleCount * circleSize
      frameCount = 24
      rowCount = 10
      
      for frame in range(frameCount):
          newPage(canvasSize, canvasSize)
          frameDuration(1/frameCount)
          circleScale = cos(pi * frame / frameCount)
      
          translate(canvasSize/2, circleSize/2)
          
          for row in range(rowCount):
              save()
              for i in range(circleCount + 1):
                  save()
                  translate(i * circleSize)
                  scale(circleScale, center=(-circleSize/2 - offset/2, 0))
                  oval(-circleSize - offset/2, -circleSize/2, circleSize, circleSize)
                  restore()
              restore()
              translate(0, circleSize)
              
      saveImage("~/Desktop/circleTest.gif")
      

      And this is the output:
      circleTest.gif

      I'm not sure how to make the animation for each row start at a different frame so that it has that wave effect. Is it possible to progressively delay the start of each row animation? Or is that not the right approach here?

      posted in Tutorials
      vitorcarvalho
      vitorcarvalho