SVGRenderer.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <div class="desc">
  12. <p>
  13. [name] can be used to render geometric data using SVG. The produced vector graphics are particular useful in the following use cases:
  14. </p>
  15. <ul>
  16. <li>Animated logos or icons</li>
  17. <li>Interactive 2D/3D diagrams or graphs</li>
  18. <li>Interactive maps</li>
  19. <li>Complex or animated user interfaces</li>
  20. </ul>
  21. <p>
  22. [name] has various advantages. It produces crystal-clear and sharp output which is independent of the actual viewport resolution.<br />
  23. SVG elements can be styled via CSS. And they have good accessibility since it's possible to add metadata like title or description (useful for search engines or screen readers).
  24. </p>
  25. <p>
  26. There are, however, some important limitations:
  27. </p>
  28. <ul>
  29. <li>No advanced shading</li>
  30. <li>No texture support</li>
  31. <li>No shadow support</li>
  32. </ul>
  33. </div>
  34. <h2>Import</h2>
  35. <p>
  36. [name] is an add-on, and must be imported explicitly.
  37. See [link:#manual/introduction/Installation Installation / Addons].
  38. </p>
  39. <code>
  40. import { SVGRenderer } from 'three/addons/renderers/SVGRenderer.js';
  41. </code>
  42. <h2>Examples</h2>
  43. <p>
  44. [example:svg_lines lines]<br />
  45. [example:svg_sandbox sandbox]
  46. </p>
  47. <h2>Constructor</h2>
  48. <h3>[name]()</h3>
  49. <h2>Properties</h2>
  50. <h3>[property:Number overdraw]</h3>
  51. <p>
  52. Number of fractional pixels to enlarge polygons in order to prevent anti-aliasing gaps. Range is [0..1]. Default is `0.5`.
  53. </p>
  54. <h2>Methods</h2>
  55. <h3>[method:undefined clear]()</h3>
  56. <p>
  57. Tells the renderer to clear its drawing surface.
  58. </p>
  59. <h3>[method:Object getSize]()</h3>
  60. <p>
  61. Returns an object containing the width and height of the renderer.
  62. </p>
  63. <h3>[method:undefined render]( [param:Scene scene], [param:Camera camera] )</h3>
  64. <p>
  65. Renders a [page:Scene scene] using a [page:Camera camera].
  66. </p>
  67. <h3>[method:undefined setClearColor]( [param:Color color], [param:number alpha] )</h3>
  68. <p>
  69. Sets the clearColor and the clearAlpha.
  70. </p>
  71. <h3>[method:undefined setPrecision]( [param:Number precision] )</h3>
  72. <p>
  73. Sets the precision of the data used to create a path.
  74. </p>
  75. <h3>[method:undefined setQuality]()</h3>
  76. <p>
  77. Sets the render quality. Possible values are `low` and `high` (default).
  78. </p>
  79. <h3>[method:undefined setSize]( [param:Number width], [param:Number height] )</h3>
  80. <p>
  81. Resizes the renderer to (width, height).
  82. </p>
  83. <h2>Source</h2>
  84. <p>
  85. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/SVGRenderer.js examples/jsm/renderers/SVGRenderer.js]
  86. </p>
  87. </body>
  88. </html>