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 ![]()
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);
}
}

