perspective.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. return {
  2. summary = 'Turn the matrix into a perspective projection.',
  3. description = [[
  4. Sets this matrix to represent a perspective projection.
  5. This can be used with `Pass:setProjection`, or it can be sent to a `Shader` for use in
  6. GLSL.
  7. ]],
  8. arguments = {
  9. fov = {
  10. type = 'number',
  11. description = 'The vertical field of view (in radians).'
  12. },
  13. aspect = {
  14. type = 'number',
  15. description = 'The horizontal aspect ratio of the projection (width / height).'
  16. },
  17. near = {
  18. type = 'number',
  19. description = 'The near plane.'
  20. },
  21. far = {
  22. type = 'number',
  23. default = '0',
  24. description = [[
  25. The far plane. Zero is a special value that will set an infinite far plane with a reversed
  26. Z range, which improves depth buffer precision and is the default.
  27. ]]
  28. },
  29. },
  30. returns = {
  31. self = {
  32. type = 'Mat4',
  33. description = 'The modified matrix.'
  34. }
  35. },
  36. variants = {
  37. {
  38. arguments = { 'fov', 'aspect', 'near', 'far' },
  39. returns = { 'self' }
  40. }
  41. },
  42. related = {
  43. 'Mat4:orthographic',
  44. 'Mat4:fov',
  45. 'Pass:setProjection'
  46. }
  47. }