// Rosetta Code problem: http://rosettacode.org/wiki/Draw_a_rotating_cube // adapted to Yabasic by Galileo, 05/2022 // GFA Punch (code from tigen.ti-fr.com/) // Carré 3D en rotation open window 50, 70 backcolor 0,0,0 clear window color 255,255,255 do clear window x = COS(T) * 20 y = SIN(T) * 18 r = SIN(T + T) line (x + 40), (y + 40 - r), (-y + 40), (x + 40 - r) line (-y + 40), (x + 40 - r), (-x + 40), (-y + 40 - r) line (-x + 40), (-y + 40 - r), (y + 40), (-x + 40 - r) line (y + 40), (-x + 40 - r), (x + 40), (y + 40 - r) line (x + 40), (y + 20 + r), (-y + 40), (x + 20 + r) line (-y + 40), (x + 20 + r), (-x + 40), (-y + 20 + r) line (-x + 40), (-y + 20 + r), (y + 40), (-x + 20 + r) line (y + 40), (-x + 20 + r), (x + 40), (y + 20 + r) line (x + 40), (y + 40 - r), (x + 40), (y + 20 + r) line (-y + 40), (x + 40 - r), (-y + 40), (x + 20 + r) line (-x + 40), (-y + 40 - r), (-x + 40), (-y + 20 + r) line (y + 40), (-x + 40 - r), (y + 40), (-x + 20 + r) pause 0.02 T = T + 0.15 loop