Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
otros:interactive0 [2013/06/23 23:53] alfred [Pequeños trucos] |
otros:interactive0 [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 15: | Línea 15: | ||
| float speed = dist(pmouseX, pmouseY, mouseX, mouseY); | float speed = dist(pmouseX, pmouseY, mouseX, mouseY); | ||
| float alpha = map(speed, 0, 20, 0, 10); | float alpha = map(speed, 0, 20, 0, 10); | ||
| - | println(alpha); | ||
| float lineWidth = map(speed, 0, 10, 10, 1); | float lineWidth = map(speed, 0, 10, 10, 1); | ||
| lineWidth = constrain(lineWidth, 0, 10); | lineWidth = constrain(lineWidth, 0, 10); | ||
| stroke(red, green, blue, 255); | stroke(red, green, blue, 255); | ||
| strokeWeight(lineWidth); | strokeWeight(lineWidth); | ||
| - | line(width/2+((width/2)-pmouseX), pmouseX, width/2+((width/2)-mouseX), mouseY); | + | line(width/2+((width/2)-pmouseX), pmouseX, width/2+((width/2)-mouseX), mouseY); |
| } | } | ||
| </code> | </code> | ||
| + | ==== Ejemplos ==== | ||
| + | === Curso de programación interactiva === | ||
| + | * {{:otros:interactiveprogramming:week_1_code_samples_sonicpainterdesktop.zip|Semana 1}} Carga de sonidos y reflejo. | ||
| + | {{:otros:interactiveprogramming:pantallazo-sonicpainterdesktop.png?200|}} | ||