Recreating the Death Star with ESP32\ILI9341

I just watched ' Making of the Computer Graphics for Star Wars (Episode IV) on youtube. Larry Cuba
made the Death Star graphics in 1976-ish So I thought this would be a piece of cake. All I have so far is a circle of dots :roll_eyes:
I'm able to draw a circle of dots around a fixed axis point. Now I need to rotate said circle around the y axis. Any help would be most appreciated.
My simple code follows....

void loop()
{
  draw_circle ();
}

  void draw_circle ()
{
    int SCREEN_W = 320;  // My Screen 240 x 320
    int SCREEN_H = 240;
    int x, y;                     // Code idea from https://www.helixsoft.nl/articles/circle/sincos.htm
    int length = 90;             // shakin and stirred to suit my needs ;)
    float angle = 0.0;
    float angle_stepsize = 0.15;  //Has about the same amount as the Movie ;)

// go through all angles from 0 to 2 * PI radians
    while (angle < 2 * PI)
    {
        // calculate x, y from a vector with known length and angle
        x = length * cos (angle);
        y = length * sin (angle);

        
   
        tft.drawPixel(x + SCREEN_W / 2, y + SCREEN_H / 2, TFT_WHITE);
        angle += angle_stepsize;

   int x0 = 74;
   int y0 = 120;
   int x1 = 246;
   int y1 = 120;
   
        tft.drawLine(x0, y0, x1, y1, TFT_WHITE);
  }
}

Having made a little progress on my own with this I may take it over to the programming Forum
to see if I get any replies over there :smiley:

That's done by making a moderator request, not starting a new thread. FYI

Hint: I wanted to display moon phases, so I thought about 3d rotation and all that. Then it dawned on me, the rotation can just be done by scaling, the "rotated" circles are just ellipses. :wink:

Haha that's was my conclusion also so my code has just scaled the original circle on the x-axis. Animating this could fry my basic brain but hey, I've learnt soo much already and I've found coding this to be rather relaxing.
Thanks for your reply

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.