Jump to content

Draw a rotating cube: Difference between revisions

(Draw a rotating cube en BASIC256)
Line 3,116:
{{out}}
http://www.xpl0.org/rotcube2.gif
 
=={{header|Yabasic}}==
<lang Yabasic>// 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</lang>
 
[[Category:Geometry]]
672

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.