SVGRenderer.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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>Examples</h2>
  35. <p>
  36. [example:svg_lines lines]<br />
  37. [example:svg_sandbox sandbox]
  38. </p>
  39. <h2>Constructor</h2>
  40. <h3>[name]()</h3>
  41. <h2>Properties</h2>
  42. <h3>[property:Number overdraw]</h3>
  43. <p>
  44. Number of fractional pixels to enlarge polygons in order to prevent anti-aliasing gaps. Range is [0..1]. Default is `0.5`.
  45. </p>
  46. <h2>Methods</h2>
  47. <h3>[method:undefined clear]()</h3>
  48. <p>
  49. Tells the renderer to clear its drawing surface.
  50. </p>
  51. <h3>[method:Object getSize]()</h3>
  52. <p>
  53. Returns an object containing the width and height of the renderer.
  54. </p>
  55. <h3>[method:undefined render]( [param:Scene scene], [param:Camera camera] )</h3>
  56. <p>
  57. Renders a [page:Scene scene] using a [page:Camera camera].
  58. </p>
  59. <h3>[method:undefined setClearColor]( [param:Color color], [param:number alpha] )</h3>
  60. <p>
  61. Sets the clearColor and the clearAlpha.
  62. </p>
  63. <h3>[method:undefined setPrecision]( [param:Number precision] )</h3>
  64. <p>
  65. Sets the precision of the data used to create a path.
  66. </p>
  67. <h3>[method:undefined setQuality]()</h3>
  68. <p>
  69. Sets the render quality. Possible values are `low` and `high` (default).
  70. </p>
  71. <h3>[method:undefined setSize]( [param:Number width], [param:Number height] )</h3>
  72. <p>
  73. Resizes the renderer to (width, height).
  74. </p>
  75. <h2>Source</h2>
  76. <p>
  77. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/SVGRenderer.js examples/jsm/renderers/SVGRenderer.js]
  78. </p>
  79. </body>
  80. </html>