MeshBasicMaterial.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. <div class="desc">A material for drawing geometries in a simple shaded (flat or wireframe) way.</div>
  14. <div class="desc">The default will render as flat polygons. To draw the mesh as wireframe, simply set the 'wireframe' property to true.</div>
  15. <iframe id="scene" src="scenes/material-browser.html#MeshBasicMaterial"></iframe>
  16. <script>
  17. // iOS iframe auto-resize workaround
  18. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  19. var scene = document.getElementById( 'scene' );
  20. scene.style.width = getComputedStyle( scene ).width;
  21. scene.style.height = getComputedStyle( scene ).height;
  22. scene.setAttribute( 'scrolling', 'no' );
  23. }
  24. </script>
  25. <h2>Constructor</h2>
  26. <h3>[name]( [page:Object parameters] )</h3>
  27. <div>parameters is an object with one or more properties defining the material's appearance.</div>
  28. <div>
  29. color — geometry color in hexadecimal. Default is 0xffffff.<br />
  30. map — Set texture map. Default is null <br />
  31. aoMap — Set ao map. Default is null.<br />
  32. aoMapIntensity — Set ao map intensity. Default is 1.<br />
  33. specularMap — Set specular map. Default is null.<br />
  34. alphaMap — Set alpha map. Default is null.<br />
  35. envMap — Set env map. Default is null.<br />
  36. combine — Set combine operation. Default is THREE.MultiplyOperation.<br />
  37. reflectivity — Set reflectivity. Default is 1.<br />
  38. refractionRatio — Set refraction ratio. Default is 0.98.<br />
  39. fog — Define whether the material color is affected by global fog settings. Default is true.<br />
  40. shading — Define shading type. Default is THREE.SmoothShading.<br />
  41. wireframe — render geometry as wireframe. Default is false.<br />
  42. wireframeLinewidth — Line thickness. Default is 1.<br />
  43. wireframeLinecap — Define appearance of line ends. Default is 'round'.<br />
  44. wireframeLinejoin — Define appearance of line joints. Default is 'round'.<br />
  45. vertexColors — Define how the vertices gets colored. Default is THREE.NoColors.<br />
  46. skinning — Define whether the material uses skinning. Default is false.<br />
  47. morphTargets — Define whether the material uses morphTargets. Default is false.
  48. </div>
  49. <h2>Properties</h2>
  50. <div>See the base [page:Material] class for common properties.</div>
  51. <h3>[property:Integer color]</h3>
  52. <div>Sets the color of the geometry. Default is 0xffffff.</div>
  53. <h3>[property:Texture map]</h3>
  54. <div>
  55. Set texture map. Default is null.
  56. </div>
  57. <h3>[property:Texture aoMap]</h3>
  58. <div>Set ambient occlusion map. Default is null.</div>
  59. <h3>[property:Float aoMapIntensity]</h3>
  60. <div>TODO</div>
  61. <h3>[property:Texture specularMap]</h3>
  62. <div>Set specular map. Default is null.</div>
  63. <h3>[property:Texture alphaMap]</h3>
  64. <div>The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). Default is null.</div>
  65. <div>Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.</div>
  66. <h3>[property:TextureCube envMap]</h3>
  67. <div>Set env map. Default is null.</div>
  68. <h3>[property:Integer combine]</h3>
  69. <div>How to combine the result of the surface's color with the environment map, if any.</div>
  70. <div>Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation], [page:Materials THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
  71. <h3>[property:Float reflectivity]</h3>
  72. <div>How much the environment map affects the surface; also see "combine".</div>
  73. <h3>[property:Float refractionRatio]</h3>
  74. <div>The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.</div>
  75. <h3>[property:Boolean fog]</h3>
  76. <div>Define whether the material color is affected by global fog settings.</div>
  77. <div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
  78. <h3>[property:String shading]</h3>
  79. <div>Define shading type. Default is THREE.SmoothShading.</div>
  80. <h3>[property:Boolean wireframe]</h3>
  81. <div>Render geometry as wireframe. Default is false (i.e. render as flat polygons).</div>
  82. <h3>[property:Float wireframeLinewidth]</h3>
  83. <div>Controls wireframe thickness. Default is 1.</div>
  84. <div>Due to limitations in the <a href="https://code.google.com/p/angleproject/" target="_blank">ANGLE layer</a>, on Windows platforms linewidth will always be 1 regardless of the set value.</div>
  85. <h3>[property:String wireframeLinecap]</h3>
  86. <div>Define appearance of line ends. Possible values are "butt", "round" and "square". Default is 'round'.</div>
  87. <div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
  88. <h3>[property:String wireframeLinejoin]</h3>
  89. <div>Define appearance of line joints. Possible values are "round", "bevel" and "miter". Default is 'round'.</div>
  90. <div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:WebGLRenderer WebGL] renderer, but does work with the [page:CanvasRenderer Canvas] renderer.</div>
  91. <h3>[property:Integer vertexColors]</h3>
  92. <div>Define how the vertices gets colored. Possible values are THREE.NoColors, THREE.FaceColors and THREE.VertexColors. Default is THREE.NoColors.</div>
  93. <div>This setting might not have any effect when used with certain renderers. For example, it is ignored with the [page:CanvasRenderer Canvas] renderer, but does work with the [page:WebGLRenderer WebGL] renderer.</div>
  94. <h3>[property:Boolean skinning]</h3>
  95. <div>Define whether the material uses skinning. Default is false.</div>
  96. <h3>[property:Boolean morphTargets]</h3>
  97. <div>Define whether the material uses morphTargets. Default is false.</div>
  98. <h2>Methods</h2>
  99. <h2>Source</h2>
  100. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  101. </body>
  102. </html>