sphere.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. return {
  2. tag = 'drawing',
  3. summary = 'Draw a sphere.',
  4. description = 'Draws a sphere',
  5. arguments = {
  6. x = {
  7. type = 'number',
  8. default = '0',
  9. description = 'The x coordinate of the center of the sphere.'
  10. },
  11. y = {
  12. type = 'number',
  13. default = '0',
  14. description = 'The y coordinate of the center of the sphere.'
  15. },
  16. z = {
  17. type = 'number',
  18. default = '0',
  19. description = 'The z coordinate of the center of the sphere.'
  20. },
  21. radius = {
  22. type = 'number',
  23. default = '1',
  24. description = 'The radius of the sphere.'
  25. },
  26. angle = {
  27. type = 'number',
  28. default = '0',
  29. description = 'The rotation of the sphere around its rotation axis, in radians.'
  30. },
  31. ax = {
  32. type = 'number',
  33. default = '0',
  34. description = 'The x component of the axis of rotation.'
  35. },
  36. ay = {
  37. type = 'number',
  38. default = '1',
  39. description = 'The y component of the axis of rotation.'
  40. },
  41. az = {
  42. type = 'number',
  43. default = '0',
  44. description = 'The z component of the axis of rotation.'
  45. },
  46. position = {
  47. type = 'Vec3',
  48. description = 'The position of the sphere.'
  49. },
  50. orientation = {
  51. type = 'Quat',
  52. description = 'The orientation of the sphere.'
  53. },
  54. transform = {
  55. type = 'Mat4',
  56. description = 'The transform of the sphere.'
  57. },
  58. longitudes = {
  59. type = 'number',
  60. default = '48',
  61. description = 'The number of "horizontal" segments.'
  62. },
  63. latitudes = {
  64. type = 'number',
  65. default = 'longitudes / 2',
  66. description = 'The number of "vertical" segments.'
  67. }
  68. },
  69. returns = {},
  70. variants = {
  71. {
  72. arguments = { 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'longitudes', 'latitudes' },
  73. returns = {}
  74. },
  75. {
  76. arguments = { 'position', 'radius', 'orientation', 'longitudes', 'latitudes' },
  77. returns = {}
  78. },
  79. {
  80. arguments = { 'transform', 'longitudes', 'latitudes' },
  81. returns = {}
  82. }
  83. },
  84. notes = 'The local origin of the sphere is in its center.'
  85. }