Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

73
Vistas
Perfect loop frameCount

I'm having trouble figuring out after how many frames the animation completes in order to create a perfect loop. I'm currently recording my canvas in 60 fps. Any ideas?

for (x = 0; x < pg.width; x += 2) {
    for (y = 0; y < pg.height; y += 2) {
      let csize = map(sin(x+y+frameCount/10), -1, 1, 2, 20);
      if (a[x][y] > 0) {
        rect(x*2-csize/2, y*2-csize/2, csize);
    }
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should check for when sin(x+y+0/10) equals sin(x+y+frameCount/10) since I'm assuming that's the only place where you use frameCount.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda