SVGRenderer.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. <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. [name] has various advantages. It produces crystal-clear and sharp output which is independet of the actual viewport resolution.<br />
  22. 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).
  23. </p>
  24. <p>
  25. There are, however, some important limitations:
  26. <ul>
  27. <li>No advanced shading</li>
  28. <li>No texture support</li>
  29. <li>No shadow support</li>
  30. </ul>
  31. </p>
  32. </div>
  33. <script>
  34. // iOS iframe auto-resize workaround
  35. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  36. var scene = document.getElementById( 'scene' );
  37. scene.style.width = getComputedStyle( scene ).width;
  38. scene.style.height = getComputedStyle( scene ).height;
  39. scene.setAttribute( 'scrolling', 'no' );
  40. }
  41. </script>
  42. <h2>Examples</h2>
  43. <div>
  44. [example:svg_lines lines]<br />
  45. [example:svg_sandbox sandbox]
  46. </div>
  47. <h2>Constructor</h2>
  48. <h3>[name]()</h3>
  49. <h2>Methods</h2>
  50. <h3>[method:null clear]()</h3>
  51. <div>
  52. Tells the renderer to clear its drawing surface.
  53. </div>
  54. <h3>[method:null render]( [param:Scene scene], [param:Camera camera] )</h3>
  55. <div>
  56. Renders a [page:Scene scene] using a [page:Camera camera].
  57. </div>
  58. <h3>[method:null setClearColor]( [param:Color color], [param:number alpha] )</h3>
  59. <div>
  60. Sets the clearColor and the clearAlpha.
  61. </div>
  62. <h3>[method:null setPrecision]( [param:Number precision] )</h3>
  63. <div>
  64. Sets the precision of the data used to create a path.
  65. </div>
  66. <h3>[method:null setQuality]()</h3>
  67. <div>
  68. Sets the render quality. Possible values are *low* and *high* (default).
  69. </div>
  70. <h3>[method:null setSize]( [param:Number width], [param:Number height] )</h3>
  71. <div>
  72. Resizes the renderer to (width, height).
  73. </div>
  74. <h2>Source</h2>
  75. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/[path].js examples/js/[path].js]
  76. </body>
  77. </html>