FaceNormalsHelper.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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>
  27. object -- object for which to render face normals<br />
  28. size -- size (length) of the arrows<br />
  29. color -- color of the arrows<br />
  30. linewidth -- width of the arrow lines
  31. </div>
  32. <h2>Properties</h2>
  33. <h3>[property:Object3D object]</h3>
  34. <div>
  35. The attached object
  36. </div>
  37. <h2>Methods</h2>
  38. <h3>[method:null update]()</h3>
  39. <div>Updates the face normal preview based on movement of the object.</div>
  40. <h2>Source</h2>
  41. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  42. </body>
  43. </html>