VertexNormalsHelper.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. [page:Line] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">Renders [page:ArrowHelper arrows] to visualize an object's vertex normal vectors. Requires that normals have been specified in a [page:BufferAttribute custom attribute] or have been calculated using [page:Geometry.computeVertexNormals computeVertexNormals]. </div>
  13. <h2>Example</h2>
  14. <code>
  15. geometry = new THREE.BoxGeometry( 10, 10, 10, 2, 2, 2 );
  16. material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
  17. object = new THREE.Mesh( geometry, material );
  18. edges = new THREE.VertexNormalsHelper( object, 2, 0x00ff00, 1 );
  19. scene.add( object );
  20. scene.add( edges );
  21. </code>
  22. [example:webgl_helpers Example using various helpers]
  23. <h2>Constructor</h2>
  24. <h3>[name]( [page:Object3D object], [page:Number size], [page:Color color], [page:Number linewidth] )</h3>
  25. <div>object -- object for which to render vertex normals
  26. size -- size (length) of the arrows
  27. color -- color of the arrows
  28. linewidth -- width of the arrow lines
  29. </div>
  30. <h2>Properties</h2>
  31. <h3>[property:Object3D object]</h3>
  32. <div>
  33. The attached object
  34. </div>
  35. <h2>Methods</h2>
  36. <h3>[method:null update]()</h3>
  37. <div>Updates the vertex normal preview based on movement of the object.</div>
  38. <h2>Source</h2>
  39. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  40. </body>
  41. </html>