SVGRenderer.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. <p>
  14. [name] can be used to render geometric data using SVG. The produced vector graphics are particular useful in the following use cases:
  15. </p>
  16. <ul>
  17. <li>Animated logos or icons</li>
  18. <li>Interactive 2D/3D diagrams or graphs</li>
  19. <li>Interactive maps</li>
  20. <li>Complex or animated user interfaces</li>
  21. </ul>
  22. <p>
  23. [name] has various advantages. It produces crystal-clear and sharp output which is independent of the actual viewport resolution.<br />
  24. 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).
  25. </p>
  26. <p>
  27. There are, however, some important limitations:
  28. </p>
  29. <ul>
  30. <li>No advanced shading</li>
  31. <li>No texture support</li>
  32. <li>No shadow support</li>
  33. </ul>
  34. </div>
  35. <script>
  36. // iOS iframe auto-resize workaround
  37. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  38. var scene = document.getElementById( 'scene' );
  39. scene.style.width = getComputedStyle( scene ).width;
  40. scene.style.height = getComputedStyle( scene ).height;
  41. scene.setAttribute( 'scrolling', 'no' );
  42. }
  43. </script>
  44. <h2>Examples</h2>
  45. <p>
  46. [example:svg_lines lines]<br />
  47. [example:svg_sandbox sandbox]
  48. </p>
  49. <h2>Constructor</h2>
  50. <h3>[name]()</h3>
  51. <h2>Properties</h2>
  52. <h3>[property:Number overdraw]</h3>
  53. <p>
  54. Number of fractional pixels to enlarge polygons in order to prevent anti-aliasing gaps. Range is [0..1]. Default is *0.5*.
  55. </p>
  56. <h2>Methods</h2>
  57. <h3>[method:null clear]()</h3>
  58. <p>
  59. Tells the renderer to clear its drawing surface.
  60. </p>
  61. <h3>[method:null render]( [param:Scene scene], [param:Camera camera] )</h3>
  62. <p>
  63. Renders a [page:Scene scene] using a [page:Camera camera].
  64. </p>
  65. <h3>[method:null setClearColor]( [param:Color color], [param:number alpha] )</h3>
  66. <p>
  67. Sets the clearColor and the clearAlpha.
  68. </p>
  69. <h3>[method:null setPrecision]( [param:Number precision] )</h3>
  70. <p>
  71. Sets the precision of the data used to create a path.
  72. </p>
  73. <h3>[method:null setQuality]()</h3>
  74. <p>
  75. Sets the render quality. Possible values are *low* and *high* (default).
  76. </p>
  77. <h3>[method:null setSize]( [param:Number width], [param:Number height] )</h3>
  78. <p>
  79. Resizes the renderer to (width, height).
  80. </p>
  81. <h2>Source</h2>
  82. <p>
  83. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/SVGRenderer.js examples/js/renderers/SVGRenderer.js]
  84. </p>
  85. </body>
  86. </html>