12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>three.js - uv mapping tests</title>
- <meta charset=utf-8 />
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- </head>
- <body>
- <script type="module">
- import {
- BoxBufferGeometry,
- CylinderBufferGeometry,
- IcosahedronBufferGeometry,
- PlaneBufferGeometry,
- LatheBufferGeometry,
- OctahedronBufferGeometry,
- SphereBufferGeometry,
- TorusBufferGeometry,
- TorusKnotBufferGeometry,
- Vector2
- } from "../build/three.module.js";
- import { UVsDebug } from './jsm/utils/UVsDebug.js';
- /*
- * This is to help debug UVs problems in geometry,
- * as well as allow a new user to visualize what UVs are about.
- */
- function test( name, geometry ) {
- var d = document.createElement( 'div' );
- d.innerHTML = '<br><br>' + name + '<br>';
- d.appendChild( UVsDebug( geometry ) );
- document.body.appendChild( d );
- }
- var points = [];
- for ( var i = 0; i < 10; i ++ ) {
- points.push( new Vector2( Math.sin( i * 0.2 ) * 15 + 50, ( i - 5 ) * 2 ) );
- }
- //
- test( 'new THREE.PlaneBufferGeometry( 100, 100, 4, 4 )', new PlaneBufferGeometry( 100, 100, 4, 4 ) );
- test( 'new THREE.SphereBufferGeometry( 75, 12, 6 )', new SphereBufferGeometry( 75, 12, 6 ) );
- test( 'new THREE.IcosahedronBufferGeometry( 30, 1 )', new IcosahedronBufferGeometry( 30, 1 ) );
- test( 'new THREE.OctahedronBufferGeometry( 30, 2 )', new OctahedronBufferGeometry( 30, 2 ) );
- test( 'new THREE.CylinderBufferGeometry( 25, 75, 100, 10, 5 )', new CylinderBufferGeometry( 25, 75, 100, 10, 5 ) );
- test( 'new THREE.BoxBufferGeometry( 100, 100, 100, 4, 4, 4 )', new BoxBufferGeometry( 100, 100, 100, 4, 4, 4 ) );
- test( 'new THREE.LatheBufferGeometry( points, 8 )', new LatheBufferGeometry( points, 8 ) );
- test( 'new THREE.TorusBufferGeometry( 50, 20, 8, 8 )', new TorusBufferGeometry( 50, 20, 8, 8 ) );
- test( 'new THREE.TorusKnotBufferGeometry( 50, 10, 12, 6 )', new TorusKnotBufferGeometry( 50, 10, 12, 6 ) );
- </script>
- </body>
- </html>
|