Created
April 8, 2012 16:01
-
-
Save jensarps/2338163 to your computer and use it in GitHub Desktop.
Modifying the object added to the scene
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onModelLoaded: function(collada){ | |
var object = collada.scene; | |
// some stuff here | |
var mesh = object.children.filter(function(child){ | |
return child instanceof THREE.Mesh; | |
})[0]; | |
object.geometry = mesh.geometry; | |
scene.add(object); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onModelLoaded: function(collada){ | |
var object = collada.scene; | |
// some stuff here | |
var geometries = collada.dae.geometries; | |
for(var propName in geometries){ | |
if(geometries.hasOwnProperty(propName) && geometries[propName].mesh){ | |
object.geometry = geometries[propName].mesh.geometry3js; | |
} | |
} | |
scene.add(object); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onModelLoaded: function(collada){ | |
var object = collada.scene; | |
// some stuff here | |
object.geometry = collada.dae.geometries['space_frig-mesh'].mesh.geometry3js; | |
scene.add(object); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onModelLoaded: function(collada) { | |
var object = collada.scene; | |
// some stuff here | |
scene.add(object); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment