提交 c4fa2dd0 编写于 作者: F Fernando Serrano

Added support for multiple scenes

上级 483d3396
......@@ -66,6 +66,7 @@
camera.position.y = 400;
scene = new THREE.Scene();
scene.name = 'Scene1';
var light, object;
......@@ -188,8 +189,16 @@
scene.add( object );
*/
var scene2 = new THREE.Scene();
object = new THREE.Mesh( new THREE.BoxBufferGeometry( 100, 100, 100 ), material );
object.position.set( 0, 0, 0 );
object.name = "Cube2ndScene";
scene2.name = 'Scene2';
scene2.add(object);
var gltfExporter = new THREE.GLTFExporter();
gltfExporter.parse( scene, function( result ) {
gltfExporter.parse( [scene, scene2], function( result ) {
console.log( JSON.stringify( result, null, 2 ) );
} );
......
......@@ -420,7 +420,8 @@ THREE.GLTFExporter.prototype = {
* @param {THREE.Scene} node Scene to process
*/
function processScene( scene ) {
if ( !outputJSON.scene ) {
console.log('Processing scene');
if ( !outputJSON.scenes ) {
outputJSON.scenes = [];
outputJSON.scene = 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册