Advertisement
matrefeytontias

[Axe] Clipped triangle routine (arguments from -512 to 511)

Jul 4th, 2013
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. E90D3→°DX1+2→°DX2+2→°SX1+2→°SX2
  2.  
  3. Lbl Triangle
  4. If r2>>r4
  5. Exch(°r1,°r3,4)
  6. End
  7. If r4>>r6
  8. Exch(°r3,°r5,4)
  9. End
  10. If r2>>r4
  11. Exch(°r1,°r3,4)
  12. End
  13.  
  14. r3-r1*64//(r4-r2→X?,1)→DX1
  15. r5-r1*64//(r6-r2→X?,1)→DX2
  16.  
  17. r1*64→SX1→SX2
  18. r2→Y
  19.  
  20. For(2)
  21. While 1
  22. If Y<64
  23. !If SX1·SX2ee0
  24. min(max(SX1,0)r/64,95)→Z
  25. min(max(SX2,0)r/64,95)→Θ
  26. .Remember that HLine(Y,X1,X) is broken in 1.2.1, so remember to update it with the next versions of Axe
  27. Line(Z,Y,Θ,Y)
  28. End
  29. End
  30. DX1+SX1→SX1
  31. DX2+SX2→SX2
  32. Y++
  33. EndIf Y+1>>r4
  34. If r6-r4→X
  35. r5-r3*64//X
  36. Else
  37. r5-r3*64
  38. End
  39. →DX1
  40. r6→r4
  41. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement