misc_uv_tests.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset=utf-8 />
  5. <title>three.js - uv mapping tests</title>
  6. </head>
  7. <body>
  8. <script src="../build/three.min.js"></script>
  9. <script src="js/utils/UVsDebug.js"></script>
  10. <script>
  11. /*
  12. * This is to help debug UVs problems in geometry,
  13. * as well as allow a new user to visualize what UVs are about.
  14. */
  15. function test(name, geometry) {
  16. var d = document.createElement('div');
  17. d.innerHTML = '<br><br>' + name + '<br>';
  18. d.appendChild(THREE.UVsDebug(geometry));
  19. document.body.appendChild(d);
  20. }
  21. test('new THREE.PlaneGeometry( 100, 100, 4, 4 )', new THREE.PlaneGeometry( 100, 100, 4, 4 ));
  22. test('new THREE.SphereGeometry( 75, 12, 6 )', new THREE.SphereGeometry( 75, 12, 6 ));
  23. test('new THREE.IcosahedronGeometry( 30, 1 )', new THREE.IcosahedronGeometry( 30, 1 ));
  24. test('new THREE.OctahedronGeometry( 30, 2 )', new THREE.OctahedronGeometry( 30, 2 ));
  25. test('new THREE.CylinderGeometry( 25, 75, 100, 10, 5 )', new THREE.CylinderGeometry( 25, 75, 100, 10, 5 ));
  26. test('new THREE.BoxGeometry( 100, 100, 100, 4, 4, 4 )', new THREE.BoxGeometry( 100, 100, 100, 4, 4, 4 ));
  27. var points = [];
  28. for ( var i = 0; i < 10; i ++ ) {
  29. points.push( new THREE.Vector3( Math.sin( i * 0.2 ) * 15 + 50, 0, ( i - 5 ) * 2 ) );
  30. }
  31. test('new THREE.LatheGeometry( points, 8 )', new THREE.LatheGeometry( points, 8 ));
  32. test('new THREE.TorusGeometry( 50, 20, 8, 8 )', new THREE.TorusGeometry( 50, 20, 8, 8 ));
  33. test('new THREE.TorusKnotGeometry( 50, 10, 12, 6 )', new THREE.TorusKnotGeometry( 50, 10, 12, 6 ));
  34. </script>
  35. </body>
  36. </html>