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 | ||
|
wiki2:graphics [2015/10/14 07:39] alfred [Draw circle] |
wiki2:graphics [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 30: | Línea 30: | ||
| auto angle = .0; | auto angle = .0; | ||
| auto x = 0, y = 0; | auto x = 0, y = 0; | ||
| + | auto radio = 300; | ||
| while (angle < 360) { | while (angle < 360) { | ||
| // calculate x, y from a vector with known length and angle | // calculate x, y from a vector with known length and angle | ||
| - | x = 300 * cos (angle * DEG_TO_RAD); | + | x = radio * cos (angle * DEG_TO_RAD); |
| - | y = 300 * sin (angle * DEG_TO_RAD); | + | y = radio * sin (angle * DEG_TO_RAD); |
| ofCircle(x + ofGetWidth() / 2, y + ofGetHeight() / 2, 3); | ofCircle(x + ofGetWidth() / 2, y + ofGetHeight() / 2, 3); | ||
| angle += 10; | angle += 10; | ||