Sprite.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. [page:Object3D] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">A sprite is a plane in an 3d scene which faces always towards the camera. </div>
  14. <div class="desc">Sprites do not cast shadows, setting <code>castShadow = true</code> will have no effect.</div>
  15. <h2>Example</h2>
  16. <code>
  17. var map = new THREE.TextureLoader().load( "sprite.png" );
  18. var material = new THREE.SpriteMaterial( { map: map, color: 0xffffff, fog: true } );
  19. var sprite = new THREE.Sprite( material );
  20. scene.add( sprite );
  21. </code>
  22. <h2>Constructor</h2>
  23. <h3>[name]([page:Material material])</h3>
  24. <div>
  25. material — An instance of [page:Material] (optional).
  26. </div>
  27. <div>
  28. This creates a new sprite with an specific material.
  29. </div>
  30. <h2>Properties</h2>
  31. <h3>[property:SpriteMaterial material]</h3>
  32. <div>
  33. An instance of [page:Material], defining the object's appearance. Default is a [page:SpriteMaterial] which is a white plane.
  34. </div>
  35. -
  36. <h2>Methods</h2>
  37. <h3>[method:Sprite clone]()</h3>
  38. <div>
  39. This creates a new clone of the sprite.
  40. </div>
  41. <h3>[method:Object3D clone]([page:Object3D object])</h3>
  42. <div>
  43. object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned Sprite Object.
  44. </div>
  45. <div>
  46. Clone a Sprite Object.
  47. </div>
  48. <h2>Source</h2>
  49. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  50. </body>
  51. </html>