FaceNormalsHelper.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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:Line] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">Renders [page:ArrowHelper arrows] to visualize an object's [page:Face3 face] normals. Requires that the object's geometry be an instance of [page:Geometry] (does not work with [page:BufferGeometry]), and that face normals have been specified on all [page:Face3 faces] or calculated with [page:Geometry.computeFaceNormals computeFaceNormals].</div>
  14. <h2>Example</h2>
  15. <code>
  16. geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
  17. material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
  18. object = new THREE.Mesh( geometry, material );
  19. edges = new THREE.FaceNormalsHelper( object, 2, 0x00ff00, 1 );
  20. scene.add( object );
  21. scene.add( edges );
  22. </code>
  23. [example:webgl_helpers Example using various helpers]
  24. <h2>Constructor</h2>
  25. <h3>[name]( [page:Object3D object], [page:Number size], [page:Color color], [page:Number linewidth] )</h3>
  26. <div>object -- object for which to render face normals
  27. size -- size (length) of the arrows
  28. color -- color of the arrows
  29. linewidth -- width of the arrow lines
  30. </div>
  31. <h2>Properties</h2>
  32. <h3>[property:Object3D object]</h3>
  33. <div>
  34. The attached object
  35. </div>
  36. <h2>Methods</h2>
  37. <h3>[method:null update]()</h3>
  38. <div>Updates the face normal preview based on movement of the object.</div>
  39. <h2>Source</h2>
  40. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  41. </body>
  42. </html>