summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo <leo@azuminha.com>2024-02-16 14:44:41 -0300
committerleo <leo@azuminha.com>2024-02-16 14:44:41 -0300
commit3db62d1f4087554b86765abd5724faf61ab2a3c3 (patch)
treefa905ee530eaad33238d09428987441e86eb9806
parent10f9fd02f78e6818b0b157d14b348fd36682fedb (diff)
nao foi otimizado ainda, mas deixei pequeno para nao ficar tao ruimHEADmaster
-rw-r--r--donut.c10
-rw-r--r--main.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/donut.c b/donut.c
index 2460dda..46d7697 100644
--- a/donut.c
+++ b/donut.c
@@ -11,7 +11,7 @@ point3d light3 = {-5, 0, -5};
//center nao deve ter passado pela funcao map antes
void draw_circle(point2d center, double radius){
double angle = 0;
- static display buf[198135*4];
+ static display buf[198135];
int buf_index = 0;
@@ -50,7 +50,7 @@ void draw_circle(point2d center, double radius){
// aux = map(aux);
if(lv > 0){
- int alp = 255 * lv / 5;
+ int alp = 255 * lv / 1;
alp = (alp > 255 ? 255 : alp);
// DrawPixel(aux.x, aux.y, (Color){0, 255, 0, alp});
buf[buf_index].p = tmp3;
@@ -61,14 +61,14 @@ void draw_circle(point2d center, double radius){
}
buf_index++;
}
- angle += 0.005;
+ angle += 0.020;
}
static_angle += 0.15;
//n_static_angle += 0.01;
- my_qsort(buf, 0, 198135*4-1);
- for(int i=0; i<198135*4; ++i){
+ my_qsort(buf, 0, 198135-1);
+ for(int i=0; i<198135; ++i){
point2d p;
p.x = buf[i].p.x;
p.y = buf[i].p.y;
diff --git a/main.c b/main.c
index af0e2c0..f6d2475 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ int main(){
//draw line 0 0 0.5 0.5
//DrawLine(p1.x, p1.y, p2.x, p2.y, RED);
- draw_circle((point2d){0.50, 0.0}, 0.25);
+ draw_circle((point2d){0.10, 0.0}, 0.05);
EndDrawing();
}