PointsMaterial.html 3.3 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. [page:Material] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">The default material used by [page:Points].</p>
  14. <h2>Examples</h2>
  15. <p>
  16. [example:misc_controls_fly misc / controls / fly]<br />
  17. [example:webgl_buffergeometry_drawcalls WebGL / BufferGeometry / drawcalls]<br />
  18. [example:webgl_buffergeometry_points WebGL / BufferGeometry / points]<br />
  19. [example:webgl_buffergeometry_points_interleaved WebGL / BufferGeometry / points / interleaved]<br />
  20. [example:webgl_camera WebGL / camera ]<br />
  21. [example:webgl_geometry_convex WebGL / geometry / convex]<br />
  22. [example:webgl_geometry_shapes WebGL / geometry / shapes]<br />
  23. [example:webgl_interactive_raycasting_points WebGL / interactive / raycasting / points]<br />
  24. [example:webgl_multiple_elements_text WebGL / multiple / elements / text]<br />
  25. [example:webgl_points_billboards WebGL / points / billboards]<br />
  26. [example:webgl_points_dynamic WebGL / points / dynamic]<br />
  27. [example:webgl_points_sprites WebGL / points / sprites]<br />
  28. [example:webgl_trails WebGL / trails]
  29. </p>
  30. <code>
  31. //This will add a starfield to the background of a scene
  32. var starsGeometry = new THREE.Geometry();
  33. for ( var i = 0; i < 10000; i ++ ) {
  34. var star = new THREE.Vector3();
  35. star.x = THREE.Math.randFloatSpread( 2000 );
  36. star.y = THREE.Math.randFloatSpread( 2000 );
  37. star.z = THREE.Math.randFloatSpread( 2000 );
  38. starsGeometry.vertices.push( star );
  39. }
  40. var starsMaterial = new THREE.PointsMaterial( { color: 0x888888 } );
  41. var starField = new THREE.Points( starsGeometry, starsMaterial );
  42. scene.add( starField );
  43. </code>
  44. <h3>[name]( [param:Object parameters] )</h3>
  45. <p>
  46. [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
  47. Any property of the material (including any property inherited from [page:Material]) can be passed in here.<br /><br />
  48. The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal
  49. string and is *0xffffff* (white) by default. [page:Color.set]( color ) is called internally.
  50. </p>
  51. <h2>Properties</h2>
  52. <p>See the base [page:Material] class for common properties.</p>
  53. <h3>[property:Color color]</h3>
  54. <p>[page:Color] of the material, by default set to white (0xffffff).</p>
  55. <h3>[property:Boolean isPointsMaterial]</h3>
  56. <p>
  57. Used to check whether this or derived classes are points materials. Default is *true*.<br /><br />
  58. You should not change this, as it used internally for optimisation.
  59. </p>
  60. <h3>[property:Texture map]</h3>
  61. <p>Sets the color of the points using data from a [page:Texture].</p>
  62. <h3>[property:Boolean morphTargets]</h3>
  63. <p>Define whether the material uses morphTargets. Default is false.</p>
  64. <h3>[property:Number size]</h3>
  65. <p>Sets the size of the points. Default is 1.0.</p>
  66. <h3>[property:Boolean sizeAttenuation]</h3>
  67. <p>Specify whether points' size is attenuated by the camera depth. (Perspective camera only.) Default is true.</p>
  68. <h2>Methods</h2>
  69. <h2>Source</h2>
  70. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  71. </body>
  72. </html>