Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script async src="https://ga.jspm.io/npm:es-module-shims@1.5.1/dist/es-module-shims.js" crossorigin="anonymous"></script>
<script type="importmap">
  {
    "imports": {
      "three": "https://unpkg.com/three@0.157.0/build/three.module.js",
      "three/addons/": "https://unpkg.com/three@0.157.0/examples/jsm/"
    }
  }
</script>

<script>
	const EARTH = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAIAAQMAAAAmA4z6AAAABlBMVEVMj7b8//xNo4wsAAAbb0lEQVR42uydzY88QxjHn9JsrdciCIJfERcSCeKAEL2Jg4MEfwESB04icUDCdgkJIsGRRPAnOHIxxYqVEOsoiG0hRIitRWyj1UNV13T1THd1V5eXk2/C7O50T3/qea2u6gH+1//6X//rf/2v//W//tdsMUREDf+tzr1E+stblfAfqkAjZX48DY3+WxuwJ7GRBKDf/vcARYFObyEeYSv1Ffwn4rhUiSv61TglIArX/mP2Px+XEug06YVsT4AXEQDpwkM8QKsvsKdq+PJw5ufHuAQg6n4AqMxh6ULNEf9ANK9jBvA2P7Ynb6mKhUnb0gAQREjW8RniD/leLwL6paCosYQbzU8bml6F93XrVgXJ4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oy9MEDjyC5hALCMWsMLtBDhN9Jd8ufqR9JbRl94kQES3n7dUIHaoUDFXwGgjIPA5tUFlic8dUyhD5PXZUTFEWd4dYh1smXFhrP06QHejQYoOZNDquaSbYon6pNvVdnRAdQsHaA5K1IBjB1uOJdPKXwAimEsgOVsIWlm6/CAoVkLUHC+DqOq9p+9NUbzlpyv3RCgf/7XSQ6jZ6zmbMcXDXvhkheovLLkMsNAGXhqMKg2Byg433DJVhFHb6sLAnO+n1h3y6R2rV3iK1ilf8IscgpswicUA2CNYOislyjA0/TQFZeowOP02cPqB6gkY4ehBve7vTo4ASCEoSi4FWytdmBrlmIhgoIIXg3kOK+CIYf88scB/cxARq3uhzvu8Dy1D5DYN2f8qLmAWAAAAAAAAAAAAAAAAAAAAADpLQzaHjRZbWwMAAAAAElFTkSuQmCC';
</script>
              
            
!

CSS

              
                body {
  overflow: hidden;
  margin: 0;
}

              
            
!

JS

              
                // Issue with Character Movement Near South Pole in Three.js

import * as THREE from "three";
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";


// general setup, boring, skip to the next comment

console.clear( );

var scene = new THREE.Scene();
    scene.background = new THREE.Color( 'black' );

var camera = new THREE.PerspectiveCamera( 30, innerWidth/innerHeight );
    camera.position.set( 0, 50, 60 );
    camera.lookAt( scene.position );

var renderer = new THREE.WebGLRenderer( {antialias: true} );
    renderer.setSize( innerWidth, innerHeight );
    document.body.appendChild( renderer.domElement );
			
window.addEventListener( "resize", (event) => {
    camera.aspect = innerWidth/innerHeight;
    camera.updateProjectionMatrix( );
    renderer.setSize( innerWidth, innerHeight );
});

var light = new THREE.DirectionalLight( 'white', 3 );
    light.position.set( 1, 1, 1 );
    scene.add( light );

var northPole = new THREE.Mesh(
			new THREE.ConeGeometry( 0.5, 1, 6 ),
			new THREE.MeshLambertMaterial( {color: 'white' })
);
		northPole.position.y = 10.5;

var southPole = new THREE.Mesh(
			new THREE.ConeGeometry( 0.5, 1, 6 ),
			new THREE.MeshLambertMaterial( {color: 'white' })
);
		southPole.position.y = -10.5;
		southPole.rotation.x = Math.PI;

scene.add( northPole, southPole );

// next comment

var v = new THREE.Vector3( );
var u = new THREE.Vector3( );

var material = new THREE.LineBasicMaterial( { color: 'white' } );
var n = 500;
var points = [];
		for( var i=0; i<n; i++)
			points.push( new THREE.Vector3() );
var geometry = new THREE.BufferGeometry().setFromPoints( points );
var pos = geometry.getAttribute( 'position' );

var line = new THREE.Line( geometry, material );
scene.add( line );


// create the Earth 

var earthMap = new THREE.TextureLoader().load( EARTH ),
		earth = new THREE.Mesh(
			new THREE.SphereGeometry( 10, 64, 32 ),
    	new THREE.MeshPhongMaterial( {map: earthMap, color:'royalblue', transparent: true, opacity: 0.75, side: THREE.DoubleSide} )
    );	
		scene.add( earth );

// load a GLTF model 
//
// Created/distributed by Kenney (www.kenney.nl)
// License: (Creative Commons Zero, CC0)
// http://creativecommons.org/publicdomain/zero/1.0/
var modelURL = 'https://boytchev.github.io/suica/assets/models/spaceships/craft_miner.glb',
		model = new THREE.Group( );

scene.add( model );

const DIST = 10.3;

var loader = new GLTFLoader();
		loader.load( modelURL, gltf => {
				gltf.scene.position.set( -2, DIST-0.5, -2 );
				model.add( gltf.scene );
				model.scale.set( 1, 1, 1 );

				// fix material (metalness must be 0)
				model.traverse( child =>
				{
						if( child.isMesh )
						{
								child.material.metalness = 0;
						}
				} );
		} );



function go( speed )
{
		v.set( 1, 0, 0 );
		model.localToWorld( v );
		v.sub( model.position );
		model.rotateOnWorldAxis ( v, -speed );
}


function turn( angle )
{
		v.set( 0, 1, 0 );
		model.localToWorld( v );
		v.sub( model.position );
		model.rotateOnWorldAxis ( v, angle );
}

var clock = new THREE.Clock( );


var mouseX = 0;

function onPointerMove( event )
{
		mouseX = event.clientX/innerWidth - 1/2;
}

window.addEventListener( 'pointermove', onPointerMove );



function animationLoop( t )
{
		var dT = clock.getDelta();
	
		go( dT );
		turn( 5*mouseX*dT );
	
		// camera follows the model
		v.set( 10, 80, 0 );
		model.localToWorld( v );
		camera.position.lerp( v, dT );

		// adjust up vector
		v.set( 0, 0, -1 );
		model.localToWorld( v );
		camera.up.copy( v );
	
		// look at the model
		camera.lookAt( model.position );
	
		// path
		for( var i=n-2; i>=0; i-- )
		{
				pos.setXYZ( i+1, pos.getX(i), pos.getY(i), pos.getZ(i) );		
		}
		v.set( 0, DIST, 0 );
		model.localToWorld( v );
		pos.setXYZ( 0, v.x, v.y, v.z );
		pos.needsUpdate = true;
		
		light.position.copy( camera.position );
    renderer.render( scene, camera );
}


renderer.setAnimationLoop( animationLoop );

              
            
!
999px

Console