The Wayback Machine - https://webcf.waybackmachine.org/web/20220402034427/https://github.com/mrdoob/three.js/commit/b2dde2945663dadbeee2e3e64f17ebd6c73a8eee
Skip to content
Permalink
Browse files
Editor: Added modelviewer environment.
  • Loading branch information
mrdoob committed on Mar 12, 2021
1 parent 1e05a0d commit b2dde2945663dadbeee2e3e64f17ebd6c73a8eee
Showing with 9 additions and 1 deletion.
  1. +2 −1 editor/js/Sidebar.Scene.js
  2. +5 −0 editor/js/Viewport.js
  3. +2 −0 editor/sw.js
@@ -216,7 +216,8 @@ function SidebarScene( editor ) {
var environmentType = new UISelect().setOptions( {

'None': '',
'Background': 'Background'
'Background': 'Background',
'ModelViewer': 'ModelViewer'

} ).setWidth( '150px' );
environmentType.setValue( 'None' );
@@ -15,6 +15,8 @@ import { SetPositionCommand } from './commands/SetPositionCommand.js';
import { SetRotationCommand } from './commands/SetRotationCommand.js';
import { SetScaleCommand } from './commands/SetScaleCommand.js';

import { RoomEnvironment } from '../../examples/jsm/environments/RoomEnvironment.js';

function Viewport( editor ) {

var signals = editor.signals;
@@ -603,6 +605,9 @@ function Viewport( editor ) {
case 'Background':
scene.environment = pmremTexture;
break;
case 'ModelViewer':
scene.environment = pmremGenerator.fromScene( new RoomEnvironment() ).texture;
break;

}

@@ -52,6 +52,8 @@ const assets = [
'../examples/jsm/curves/NURBSCurve.js',
'../examples/jsm/curves/NURBSUtils.js',

'../examples/jsm/environments/RoomEnvironment.js',

'../examples/jsm/exporters/ColladaExporter.js',
'../examples/jsm/exporters/DRACOExporter.js',
'../examples/jsm/exporters/GLTFExporter.js',

0 comments on commit b2dde29

Please sign in to comment.