JSFiddle - React, Tailwind, and code Playground

by realhunts

HTML

<script src="https://cdn.rawgit.com/mrdoob/three.js/r85/build/three.min.js"></script>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r85/examples/js/controls/OrbitControls.js"></script>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r85/examples/js/loaders/GLTF2Loader.js"></script>
<div id="container"></div>
<script type="module">
// Simple three.js example

var mesh, renderer, scene, camera, controls;

init();
animate();

function init() {

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

    // scene
    scene = new THREE.Scene();
    
    // camera
    camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 10000 );
    camera.position.set( 20, 20, 20 );

    // controls
    controls = new THREE.OrbitControls( camera );
    
    // ambient
    scene.add( new THREE.AmbientLight( 0xffffff ) );
    
    // light
    var light = new THREE.DirectionalLight( 0xffffff, 1 );
    light.position.set( 20, 20, 0 );
    scene.add( light );
    
    // axes
    scene.add( new THREE.AxisHelper( 20 ) );

   var manager = new THREE.LoadingManager();
    manager.onProgress = function ( item, loaded, total ) {
        console.log( item, loaded, total );
    };

    var loader = new THREE.GLTF2Loader();
    loader.setCrossOrigin( 'anonymous' );

    var scale = 10;
    var url = "https://cdn.rawgit.com/cx20/gltf-test/b6900f6f4d755a71691aaef5a19279da7472b69f/tutorialModels/Corset/glTF/Corset.gltf";
    loader.load(url, function (data) {
        gltf = data;
        var object;
        if ( gltf.scene !== undefined ) {
            object = gltf.scene; // default scene
        } else if ( gltf.scenes.length > 0 ) {
            object = gltf.scenes[0]; // other scene
        }
        object.scale.set(scale, scale, scale);
        var animations = gltf.animations;
        if ( animations && animations.length ) {
        ...

CSS

body {
	background-color: #000;
	margin: 0px;
	overflow: hidden;
}