mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-16 19:17:57 +01:00
48 lines
1.6 KiB
HTML
48 lines
1.6 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset=utf-8 />
|
||
|
<title>three.js - uv mapping tests</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<script src="../build/three.min.js"></script>
|
||
|
<script src="js/utils/UVsDebug.js"></script>
|
||
|
<script>
|
||
|
/*
|
||
|
* 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(THREE.UVsDebug(geometry));
|
||
|
document.body.appendChild(d);
|
||
|
}
|
||
|
|
||
|
test('new THREE.PlaneGeometry( 100, 100, 4, 4 )', new THREE.PlaneGeometry( 100, 100, 4, 4 ));
|
||
|
test('new THREE.SphereGeometry( 75, 12, 6 )', new THREE.SphereGeometry( 75, 12, 6 ));
|
||
|
|
||
|
test('new THREE.IcosahedronGeometry( 30, 1 )', new THREE.IcosahedronGeometry( 30, 1 ));
|
||
|
test('new THREE.OctahedronGeometry( 30, 2 )', new THREE.OctahedronGeometry( 30, 2 ));
|
||
|
|
||
|
test('new THREE.CylinderGeometry( 25, 75, 100, 10, 5 )', new THREE.CylinderGeometry( 25, 75, 100, 10, 5 ));
|
||
|
|
||
|
test('new THREE.BoxGeometry( 100, 100, 100, 4, 4, 4 )', new THREE.BoxGeometry( 100, 100, 100, 4, 4, 4 ));
|
||
|
|
||
|
var points = [];
|
||
|
|
||
|
for ( var i = 0; i < 10; i ++ ) {
|
||
|
|
||
|
points.push( new THREE.Vector3( Math.sin( i * 0.2 ) * 15 + 50, 0, ( i - 5 ) * 2 ) );
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
test('new THREE.LatheGeometry( points, 8 )', new THREE.LatheGeometry( points, 8 ));
|
||
|
test('new THREE.TorusGeometry( 50, 20, 8, 8 )', new THREE.TorusGeometry( 50, 20, 8, 8 ));
|
||
|
test('new THREE.TorusKnotGeometry( 50, 10, 12, 6 )', new THREE.TorusKnotGeometry( 50, 10, 12, 6 ));
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|