JSFiddle - React, Tailwind, and code Playground

by siouxcitizen

HTML

<!-- forked from [WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その14)(調整中) http://jsdo.it/cx20/0kU1 -->

<script src="https://cdn.rawgit.com/cx20/gltf-test/d390423c636eac83cc24c1cf4c17b336a4ef1564/libs/three.js/r94dev/three.js"></script>
<script src="https://cdn.rawgit.com/cx20/gltf-test/d390423c636eac83cc24c1cf4c17b336a4ef1564/libs/three.js/r94dev/controls/OrbitControls.js"></script>
<script src="https://cdn.rawgit.com/cx20/gltf-test/d390423c636eac83cc24c1cf4c17b336a4ef1564/libs/three.js/r94dev/GLTFLoader.js"></script>

<div id="container"></div>

CSS

* {
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

body {
  background: #000;
  font: 30px sans-serif;
}

JavaScript

// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その13)(調整中)" http://jsdo.it/cx20/Wrcg
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その12)(調整中)" http://jsdo.it/cx20/abdM
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その11)(調整中)" http://jsdo.it/cx20/UqP9
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その10)(調整中)" http://jsdo.it/cx20/mrOD
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その9)(調整中)" http://jsdo.it/cx20/6MMO
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その8)" http://jsdo.it/cx20/qugw
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その7)" http://jsdo.it/cx20/4r5U
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その6)" http://jsdo.it/cx20/SMjx
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その5)" http://jsdo.it/cx20/ahsW
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その4)" http://jsdo.it/cx20/waIx
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その3)(調整中)" http://jsdo.it/cx20/q0cx
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト(その2)" http://jsdo.it/cx20/K0k6
// forked from cx20's "[WebGL] three.js で glTF 2.0形式のデータを表示してみるテスト" http://jsdo.it/cx20/gMdU
// forked from cx20's "three.js で glTF 形式のデータを表示してみるテスト(その1)" http://jsdo.it/cx20/2qm8N
// forked from cx20's "three.js で OBJ 形式のデータを表示してみるテスト(その1)" http://jsdo.it/cx20/wGMY
// forked from cx20's "three.js で Blender のデータを表示してみるテスト" http://jsdo.it/cx20/2CXI
// forked from 【WebGL特集】第4回:Blenderでモデル出力 http://mox-motion.com/blog/webgl04-2/

let gltf = null;
let mixer = null;
let clock = new THREE.Clock();
let controls;
let camera;

init();
animate();
  
function init() {
    width = window.innerWidth;
    height = window.innerHeight;
    
    scene = new THREE.Scene();
    
    let ambient = new THREE.AmbientLight( 0x101030 );
    scene.add( ambient );

    const light = new...