Guest User

Untitled

a guest
Nov 8th, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1.  
  2. For now, just draw 3 walls. The angles are constants for now, with 45°.
  3.  
  4. Start values:
  5. w = 300
  6. sum_a = 0
  7.  
  8. Wall 1:
  9. a = 45
  10. start_x = 400
  11. start_y = 400
  12. center_x = start_x + (w/2) * cos(a)
  13. center_y = start_y + (w/2) * sin(a)
  14. end_x = start_x + w * cos(a)
  15. end_y = start_y + w * sin(a)
  16. sum_a = sum_a + a
  17. => Draw wall at (center_x,center_y) with angle sum_a
  18.  
  19. Wall 2:
  20. a = 45
  21. start_x = end_x
  22. start_y = end_y
  23. center_x = start_x + (w/2) * cos(a)
  24. center_y = start_y + (w/2) * sin(a)
  25. end_x = start_x + w * cos(a)
  26. end_y = start_y + w * sin(a)
  27. sum_a = sum_a + a
  28. => Draw wall at (center_x,center_y) with angle sum_a
  29.  
  30. Wall 3:
  31. a = 45
  32. start_x = end_x
  33. start_y = end_y
  34. center_x = start_x + (w/2) * cos(a)
  35. center_y = start_y + (w/2) * sin(a)
  36. end_x = start_x + w * cos(a)
  37. end_y = start_y + w * sin(a)
  38. sum_a = sum_a + a
  39. => Draw wall at (center_x,center_y) with angle sum_a
Advertisement
Add Comment
Please, Sign In to add comment