|
@@ -31,6 +31,7 @@
|
|
<script type="module">
|
|
<script type="module">
|
|
import * as THREE from 'three';
|
|
import * as THREE from 'three';
|
|
|
|
|
|
|
|
+ import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
|
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
import { GroundedSkybox } from 'three/addons/objects/GroundedSkybox.js';
|
|
import { GroundedSkybox } from 'three/addons/objects/GroundedSkybox.js';
|
|
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
@@ -39,7 +40,8 @@
|
|
|
|
|
|
const params = {
|
|
const params = {
|
|
height: 15,
|
|
height: 15,
|
|
- radius: 100
|
|
|
|
|
|
+ radius: 100,
|
|
|
|
+ enabled: true,
|
|
};
|
|
};
|
|
|
|
|
|
let camera, scene, renderer, skybox;
|
|
let camera, scene, renderer, skybox;
|
|
@@ -143,6 +145,27 @@
|
|
document.body.appendChild( renderer.domElement );
|
|
document.body.appendChild( renderer.domElement );
|
|
window.addEventListener( 'resize', onWindowResize );
|
|
window.addEventListener( 'resize', onWindowResize );
|
|
|
|
|
|
|
|
+ const gui = new GUI();
|
|
|
|
+
|
|
|
|
+ gui.add( params, 'enabled' ).name( "Grounded" ).onChange( function ( value ) {
|
|
|
|
+
|
|
|
|
+ if ( value ) {
|
|
|
|
+
|
|
|
|
+ scene.add( skybox );
|
|
|
|
+ scene.background = null;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+
|
|
|
|
+ scene.remove( skybox );
|
|
|
|
+ scene.background = scene.environment;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ render();
|
|
|
|
+
|
|
|
|
+ } );
|
|
|
|
+ gui.open();
|
|
}
|
|
}
|
|
|
|
|
|
function onWindowResize() {
|
|
function onWindowResize() {
|