<commit_before><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webvr - roller coaster</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<style>
			body {
				margin: 0px;
				color: #fff;
				font-family: Monospace;
				background-color: #444;
				overflow: hidden;
			}
			a {
				color: #00f;
			}
		</style>
	</head>
	<body>

		<script src="../build/three.js"></script>

		<script src="js/RollerCoaster.js"></script>

		<script src="js/WebVR.js"></script>
		<script src="js/effects/VREffect.js"></script>
		<script src="js/controls/VRControls.js"></script>

		<script>

			if ( WEBVR.isLatestAvailable() === false ) {

				document.body.appendChild( WEBVR.getMessage() );

			}

			//

			var renderer = new THREE.WebGLRenderer( { antialias: true } );
			renderer.setClearColor( 0xf0f0ff );
			renderer.setPixelRatio( window.devicePixelRatio );
			renderer.setSize( window.innerWidth, window.innerHeight );
			document.body.appendChild( renderer.domElement );

			var scene = new THREE.Scene();

			var light = new THREE.HemisphereLight( 0xfff0f0, 0x606066 );
			light.position.set( 1, 1, 1 );
			scene.add( light );

			var train = new THREE.Object3D();
			scene.add( train );

			var camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 5000 );
			camera.rotation.y = Math.PI;
			train.add( camera );

			// environment

			var geometry = new THREE.PlaneGeometry( 5000, 5000, 15, 15 );
			geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
			var material = new THREE.MeshLambertMaterial( { color: 0x407000, shading: THREE.FlatShading } );

			for ( var i = 0; i < geometry.vertices.length; i ++ ) {

				var vertex = geometry.vertices[ i ];

				vertex.x += Math.random() * 100 - 50;
				vertex.z += Math.random() * 100 - 50;

				var distance = ( vertex.distanceTo( scene.position ) / 5 ) - 250;

				vertex.y = Math.random() * Math.max( 0, distance );

			}

			geometry.computeFaceNormals();

			var mesh = new THREE.Mesh( geometry, material );
			scene.add( mesh );

			var geometry = new TreesGeometry( mesh );
			var material = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide, vertexColors: THREE.VertexColors } );
			var mesh = new THREE.Mesh( geometry, material );
			scene.add( mesh );

			var geometry = new SkyGeometry();
			var material = new THREE.MeshBasicMaterial( { color: 0xffffff } );
			var mesh = new THREE.Mesh( geometry, material );
			scene.add( mesh );

			//

			var PI2 = Math.PI * 2;

			var curve = ( function () {

				var vector = new THREE.Vector3();
				var vector2 = new THREE.Vector3();

				return {

					getPointAt: function ( t ) {

						t = t * PI2;

						var x = Math.sin( t * 3 ) * Math.cos( t * 4 ) * 50;
						var y = Math.cos( t * 8 ) * 4 + Math.cos( t * 17 ) + 5;
						var z = Math.sin( t ) * Math.sin( t * 4 ) * 50;

						return vector.set( x, y, z ).multiplyScalar( 20 );

					},

					getTangentAt: function ( t ) {

						var delta = 0.0001;
						var t1 = Math.max( 0, t - delta );
						var t2 = Math.min( 1, t + delta );

						return vector2.copy( this.getPointAt ( t2 ) ).sub( this.getPointAt( t1 ) ).normalize();

					}

				};

			} )();

			var geometry = new RollerCoasterGeometry( curve, 1500 );
			var material = new THREE.MeshStandardMaterial( {
				roughness: 0.1,
				metalness: 0,
				vertexColors: THREE.VertexColors
			} );
			var mesh = new THREE.Mesh( geometry, material );<commit_msg>Fixes #9114 (#9165)<commit_after><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webvr - roller coaster</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<style>
			body {
				margin: 0px;
				color: #fff;
				font-family: Monospace;
				background-color: #444;
				overflow: hidden;
			}
			a {
				color: #00f;
			}
		</style>
	</head>
	<body>

		<script src="../build/three.js"></script>

		<script src="js/RollerCoaster.js"></script>

		<script src="js/WebVR.js"></script>
		<script src="js/effects/VREffect.js"></script>
		<script src="js/controls/VRControls.js"></script>

		<script>

			if ( WEBVR.isLatestAvailable() === false ) {

				document.body.appendChild( WEBVR.getMessage() );

			}

			//

			var renderer = new THREE.WebGLRenderer( { antialias: true } );
			renderer.setClearColor( 0xf0f0ff );
			renderer.setPixelRatio( window.devicePixelRatio );
			renderer.setSize( window.innerWidth, window.innerHeight );
			document.body.appendChild( renderer.domElement );

			var scene = new THREE.Scene();

			var light = new THREE.HemisphereLight( 0xfff0f0, 0x606066 );
			light.position.set( 1, 1, 1 );
			scene.add( light );

			var train = new THREE.Object3D();
			scene.add( train );

			var camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 5000 );
			camera.rotation.y = Math.PI;
			train.add( camera );

			// environment

			var geometry = new THREE.PlaneGeometry( 5000, 5000, 15, 15 );
			geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
			var material = new THREE.MeshLambertMaterial( { color: 0x407000, shading: THREE.FlatShading } );

			for ( var i = 0; i < geometry.vertices.length; i ++ ) {

				var vertex = geometry.vertices[ i ];

				vertex.x += Math.random() * 100 - 50;
				vertex.z += Math.random() * 100 - 50;

				var distance = ( vertex.distanceTo( scene.position ) / 5 ) - 250;

				vertex.y = Math.random() * Math.max( 0, distance );

			}

			geometry.computeFaceNormals();

			var mesh = new THREE.Mesh( geometry, material );
			scene.add( mesh );

			var geometry = new TreesGeometry( mesh );
			var material = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide, vertexColors: THREE.VertexColors } );
			var mesh = new THREE.Mesh( geometry, material );
			scene.add( mesh );

			var geometry = new SkyGeometry();
			var material = new THREE.MeshBasicMaterial( { color: 0xffffff } );
			var mesh = new THREE.Mesh( geometry, material );
			scene.add( mesh );

			//

			var PI2 = Math.PI * 2;

			var curve = ( function () {

				var vector = new THREE.Vector3();
				var vector2 = new THREE.Vector3();

				return {

					getPointAt: function ( t ) {

						t *= Math.PI;

						var x = Math.sin(t * 4) * Math.cos(t * 6) * 1000;
						var y = Math.cos(t * 8) * 80 + Math.cos(t * 20 * Math.sin(t)) * 40 + 200;
						var z = Math.sin(t * 5) * Math.sin(t * 3) * 1000;

						return vector.set( x, y, z );

					},

					getTangentAt: function ( t ) {

						var delta = 0.0001;
						var t1 = Math.max( 0, t - delta );
						var t2 = Math.min( 1, t + delta );

						return vector2.copy( this.getPointAt ( t2 ) ).sub( this.getPointAt( t1 ) ).normalize();

					}

				};

			} )();

			var geometry = new RollerCoasterGeometry( curve, 1500 );
			var material = new THREE.MeshStandardMaterial( {
				roughness: 0.1,
				metalness: 0,
				vertexColors: THREE.VertexColors
			} );
			var mesh = new THREE.Mesh( geometry, material );
{'fraction_non_alphanumeric': 0.15183394938868353, 'fraction_numerical': 0.03340915553028149, 'mean_word_length': 2.7741416309012874, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5879388', 'n_tokens_mistral': 3105, 'n_tokens_neox': 2368, 'n_words': 604}