|
@ -3,7 +3,7 @@ import * as THREE from 'three'; |
|
|
import { zipSync, strToU8 } from 'three/addons/libs/fflate.module.js'; |
|
|
import { zipSync, strToU8 } from 'three/addons/libs/fflate.module.js'; |
|
|
|
|
|
|
|
|
import { UIPanel, UIRow, UIHorizontalRule } from '../libs/ui.js'; |
|
|
import { UIPanel, UIRow, UIHorizontalRule } from '../libs/ui.js'; |
|
|
|
|
|
import { AddObjectCommand } from '../commands/AddObjectCommand.js'; |
|
|
function MenubarFile( editor ) { |
|
|
function MenubarFile( editor ) { |
|
|
|
|
|
|
|
|
const config = editor.config; |
|
|
const config = editor.config; |
|
@ -31,12 +31,33 @@ function MenubarFile( editor ) { |
|
|
if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) { |
|
|
if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) { |
|
|
|
|
|
|
|
|
editor.clear(); |
|
|
editor.clear(); |
|
|
|
|
|
initLight(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} ); |
|
|
} ); |
|
|
options.add( option ); |
|
|
options.add( option ); |
|
|
|
|
|
|
|
|
|
|
|
function initLight( ) { |
|
|
|
|
|
const color = 0x222222; |
|
|
|
|
|
|
|
|
|
|
|
const light = new THREE.AmbientLight(color); |
|
|
|
|
|
light.name = '环境光源AmbientLight'; |
|
|
|
|
|
|
|
|
|
|
|
editor.execute(new AddObjectCommand(editor, light)); |
|
|
|
|
|
|
|
|
|
|
|
const color1 = 0xffffff; |
|
|
|
|
|
const intensity = 1; |
|
|
|
|
|
|
|
|
|
|
|
const directionalLight = new THREE.DirectionalLight(color1, intensity); |
|
|
|
|
|
directionalLight.name = '平行光源DirectionalLight'; |
|
|
|
|
|
directionalLight.target.name = 'DirectionalLight Target'; |
|
|
|
|
|
|
|
|
|
|
|
directionalLight.position.set(5, 10, 7.5); |
|
|
|
|
|
|
|
|
|
|
|
editor.execute(new AddObjectCommand(editor, directionalLight)); |
|
|
|
|
|
} |
|
|
//
|
|
|
//
|
|
|
|
|
|
|
|
|
options.add( new UIHorizontalRule() ); |
|
|
options.add( new UIHorizontalRule() ); |
|
|