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

GLTFExporter: Added onlyVisible option

上级 547a8a80
...@@ -57,8 +57,6 @@ THREE.GLTFExporter.prototype = { ...@@ -57,8 +57,6 @@ THREE.GLTFExporter.prototype = {
*/ */
parse: function ( input, onDone, options ) { parse: function ( input, onDone, options ) {
options = options || {};
var outputJSON = { var outputJSON = {
asset: { asset: {
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
<button id="export_objects">Export Sphere and Grid</button> <button id="export_objects">Export Sphere and Grid</button>
<button id="export_scene_object">Export Scene1 and Sphere</button> <button id="export_scene_object">Export Scene1 and Sphere</button>
<br/> <br/>
<input id="option_trs" type="checkbox" value="trs"/> TRS <label><input id="option_trs" name="trs" type="checkbox"/>TRS</label>
<label><input id="option_visible" name="visible" type="checkbox" checked="checked"/>Only Visible</label>
</div> </div>
<script src="../build/three.js"></script> <script src="../build/three.js"></script>
...@@ -44,7 +45,8 @@ ...@@ -44,7 +45,8 @@
var gltfExporter = new THREE.GLTFExporter(); var gltfExporter = new THREE.GLTFExporter();
var options = { var options = {
trs: document.getElementById('option_trs').checked trs: document.getElementById('option_trs').checked,
onlyVisible: document.getElementById('option_visible').checked,
} }
gltfExporter.parse( input, function( result ) { gltfExporter.parse( input, function( result ) {
...@@ -400,6 +402,17 @@ ...@@ -400,6 +402,17 @@
object.position.set( 200, 0, 400 ); object.position.set( 200, 0, 400 );
scene1.add( object ); scene1.add( object );
// ---------------------------------------------------------------------
// Big red box hidden just for testing `onlyVisible` option
// ---------------------------------------------------------------------
material = new THREE.MeshBasicMaterial( {
color: 0xff0000
} );
object = new THREE.Mesh( new THREE.BoxBufferGeometry( 200, 200, 200 ), material );
object.position.set( 0, 0, 0 );
object.name = "CubeHidden";
object.visible = false;
scene1.add( object );
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// 2nd Scene // 2nd Scene
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册