Advertisement
linesguy

Psuedo-3D rotating cube

Mar 30th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. 1 hgr2 : hcolor = 3
  2. 20 r1 = 60 : rem Size of cube, r2 and h are calculated automatically
  3. 30 s = 0.003 : rem Speed of cube rotating
  4. 40 r2 = r1/2
  5. 50 h = r1+r2
  6.  
  7.  
  8. 210 Poke 230,32 : gosub 300 : Poke 49236,0 : poke 230,64 : gosub 300 : poke 49237,0 : goto 210
  9.  
  10. 300 call -3086
  11. 310 x = x + s
  12. 320 y = y + s
  13. 330 hplot sin(x)*r1+r1,cos(y)*r2+r2 to sin(x)*r1+r1,cos(y)*r2+r2+h
  14. 340 hplot sin(x+1.57)*r1+r1,cos(y+1.57)*r2+r2 to sin(x+1.57)*r1+r1,cos(y+1.57)*r2+r2+h
  15. 350 hplot sin(x+3.14)*r1+r1,cos(y+3.14)*r2+r2 to sin(x+3.14)*r1+r1,cos(y+3.14)*r2+r2+h
  16. 360 hplot sin(x+4.71)*r1+r1,cos(y+4.71)*r2+r2 to sin(x+4.71)*r1+r1,cos(y+4.71)*r2+r2+h
  17. 370 hplot sin(x)*r1+r1,cos(y)*r2+r2 to sin(x+1.57)*r1+r1,cos(y+1.57)*r2+r2 to sin(x+3.14)*r1+r1,cos(y+3.14)*r2+r2 to sin(x+4.71)*r1+r1,cos(y+4.71)*r2+r2 to sin(x)*r1+r1,cos(y)*r2+r2
  18. 380 hplot sin(x)*r1+r1,cos(y)*r2+r2+h to sin(x+1.57)*r1+r1,cos(y+1.57)*r2+r2+h to sin(x+3.14)*r1+r1,cos(y+3.14)*r2+r2+h to sin(x+4.71)*r1+r1,cos(y+4.71)*r2+r2+h to sin(x)*r1+r1,cos(y)*r2+r2+h
  19.  
  20. 99999 return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement