Code viewer for World: webgl helpers
           //ported example from threejs site
           //https://threejs.org/examples/#webgl_helpers
           //https://github.com/mrdoob/three.js/blob/master/examples/webgl_helpers.html
           
           
           
           
           // load CSS from file (do everything from JS)
           
           
           
            AB.loadCSS ( '/uploads/threeport/main.css' ); 
            AB.newDiv ('container');

// path edits:

            import * as THREE from '/api/threemodule/libs/three.module.js';

            import Stats from '/uploads/threeport/stats.module.js';
			import { GLTFLoader } from '/uploads/threejs/GLTFLoader.js';

			import { VertexNormalsHelper } from '/uploads/threejs/VertexNormalsHelper.js';
			import { VertexTangentsHelper } from '/uploads/threejs/VertexTangentsHelper.js';

			let scene, renderer;
			let camera, light;
			let vnh;
			let vth;

			init();
			animate();

			function init() {

				renderer = new THREE.WebGLRenderer();
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );
				document.body.appendChild( renderer.domElement );

				//

				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 1000 );
				camera.position.z = 400;

				scene = new THREE.Scene();

				light = new THREE.PointLight();
				light.position.set( 200, 100, 150 );
				scene.add( light );

				scene.add( new THREE.PointLightHelper( light, 15 ) );

				const gridHelper = new THREE.GridHelper( 400, 40, 0x0000ff, 0x808080 );
				gridHelper.position.y = - 150;
				gridHelper.position.x = - 150;
				scene.add( gridHelper );

				const polarGridHelper = new THREE.PolarGridHelper( 200, 16, 8, 64, 0x0000ff, 0x808080 );
				polarGridHelper.position.y = - 150;
				polarGridHelper.position.x = 200;
				scene.add( polarGridHelper );

				const loader = new GLTFLoader();
				loader.load( 'uploads/threejs/LeePerrySmith.glb', function ( gltf ) {

					const mesh = gltf.scene.children[ 0 ];

					mesh.geometry.computeTangents(); // generates bad data due to degenerate UVs

					const group = new THREE.Group();
					group.scale.multiplyScalar( 50 );
					scene.add( group );

					// To make sure that the matrixWorld is up to date for the boxhelpers
					group.updateMatrixWorld( true );

					group.add( mesh );

					vnh = new VertexNormalsHelper( mesh, 5 );
					scene.add( vnh );

					vth = new VertexTangentsHelper( mesh, 5 );
					scene.add( vth );

					scene.add( new THREE.BoxHelper( mesh ) );

					const wireframe = new THREE.WireframeGeometry( mesh.geometry );
					let line = new THREE.LineSegments( wireframe );
					line.material.depthTest = false;
					line.material.opacity = 0.25;
					line.material.transparent = true;
					line.position.x = 4;
					group.add( line );
					scene.add( new THREE.BoxHelper( line ) );

					const edges = new THREE.EdgesGeometry( mesh.geometry );
					line = new THREE.LineSegments( edges );
					line.material.depthTest = false;
					line.material.opacity = 0.25;
					line.material.transparent = true;
					line.position.x = - 4;
					group.add( line );
					scene.add( new THREE.BoxHelper( line ) );

					scene.add( new THREE.BoxHelper( group ) );
					scene.add( new THREE.BoxHelper( scene ) );


				} );

				//

				window.addEventListener( 'resize', onWindowResize );

			}

			function onWindowResize() {

				camera.aspect = window.innerWidth / window.innerHeight;
				camera.updateProjectionMatrix();

				renderer.setSize( window.innerWidth, window.innerHeight );

			}

			function animate() {

				requestAnimationFrame( animate );

				const time = - performance.now() * 0.0003;

				camera.position.x = 400 * Math.cos( time );
				camera.position.z = 400 * Math.sin( time );
				camera.lookAt( scene.position );

				light.position.x = Math.sin( time * 1.7 ) * 300;
				light.position.y = Math.cos( time * 1.5 ) * 400;
				light.position.z = Math.cos( time * 1.3 ) * 300;

				if ( vnh ) vnh.update();
				if ( vth ) vth.update();

				renderer.render( scene, camera );

			}