misc_uv_tests.html 1.8 KB

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