Explorar el Código

Examples: Improve GUI in webgpu_lines_fat.html (#33498)

WestLangley hace 1 mes
padre
commit
7753e30d70
Se han modificado 2 ficheros con 14 adiciones y 2 borrados
  1. BIN
      examples/screenshots/webgpu_lines_fat.jpg
  2. 14 2
      examples/webgpu_lines_fat.html

BIN
examples/screenshots/webgpu_lines_fat.jpg


+ 14 - 2
examples/webgpu_lines_fat.html

@@ -119,6 +119,9 @@
 				line.scale.set( 1, 1, 1 );
 				scene.add( line );
 
+
+				// THREE.Line ( THREE.BufferGeometry, THREE.LineBasicNodeMaterial ) - rendered with gl.LINE_STRIP
+
 				const geo = new THREE.BufferGeometry();
 				geo.setAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
 				geo.setAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
@@ -208,7 +211,7 @@
 				const param = {
 					'line type': 0,
 					'world units': false,
-					'width': 5,
+					'width': 10,
 					'alphaToCoverage': false,
 					'dashed': false,
 					'dash offset': 0,
@@ -243,9 +246,18 @@
 					matLine.worldUnits = val;
 					matLine.needsUpdate = true;
 
+					if ( val ) {
+
+						widthController.name( 'width (world units)' ).min( 0.1 ).max( 0.5 ).setValue( 0.5 );
+
+					} else {
+
+						widthController.name( 'width (pixels)' ).min( 1 ).max( 10 ).setValue( 10 );
+					}
+
 				} );
 
-				gui.add( param, 'width', 1, 10 ).onChange( function ( val ) {
+				const widthController = gui.add( param, 'width', 1, 10 ).name( 'width (pixels)' ).onChange( function ( val ) {
 
 					matLine.linewidth = val;
 

粤ICP备19079148号