SpriteMaterial.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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:Material] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">A material for a use with a [page:Sprite].</p>
  14. <h2>Code Example</h2>
  15. <code>
  16. var spriteMap = new THREE.TextureLoader().load( 'textures/sprite.png' );
  17. var spriteMaterial = new THREE.SpriteMaterial( { map: spriteMap, color: 0xffffff } );
  18. var sprite = new THREE.Sprite( spriteMaterial );
  19. sprite.scale.set(200, 200, 1)
  20. scene.add( sprite );
  21. </code>
  22. <h2>Examples</h2>
  23. <p>
  24. [example:webgl_sprites webGL / sprites]<br />
  25. [example:software_sandbox software / sandbox]<br />
  26. [example:svg_sandbox svg / sandbox]<br />
  27. [example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]
  28. </p>
  29. <h2>Constructor</h2>
  30. <h3>[name]( [param:Object parameters] )</h3>
  31. <p>
  32. [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
  33. Any property of the material (including any property inherited from [page:Material]) can be passed in here.<br /><br />
  34. The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal
  35. string and is *0xffffff* (white) by default. [page:Color.set]( color ) is called internally.
  36. SpriteMaterials are not clipped by using [page:Material.clippingPlanes].
  37. </p>
  38. <h2>Properties</h2>
  39. <p>See the base [page:Material] class for common properties.</p>
  40. <h3>[property:Texture alphaMap]</h3>
  41. <p>The alpha map is a grayscale texture that controls the opacity across the surface
  42. (black: fully transparent; white: fully opaque). Default is null.<br /><br />
  43. Only the color of the texture is used, ignoring the alpha channel if one exists.
  44. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the
  45. green channel when sampling this texture due to the extra bit of precision provided
  46. for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
  47. luminance/alpha textures will also still work as expected.
  48. </p>
  49. <h3>[property:Color color]</h3>
  50. <p>[page:Color] of the material, by default set to white (0xffffff). The [page:.map] is mutiplied by the color.</p>
  51. <h3>[property:boolean fog]</h3>
  52. <p>Whether or not this material affected by the scene's fog. Default is false</p>
  53. <h3>[property:Texture map]</h3>
  54. <p>The texture map. Default is null.</p>
  55. <h3>[property:Radians rotation]</h3>
  56. <p>The rotation of the sprite in radians. Default is 0.</p>
  57. <h3>[property:Boolean sizeAttenuation]</h3>
  58. <p>Whether the size of the sprite is attenuated by the camera depth. (Perspective camera only.) Default is *true*.</p>
  59. <h2>Methods</h2>
  60. <p>See the base [page:Material] class for common methods.</p>
  61. <h2>Source</h2>
  62. <p>
  63. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  64. </p>
  65. </body>
  66. </html>