collada

Changing texture and color on Three.js collada object

与世无争的帅哥 提交于 2019-12-01 03:59:07
I recently got three.js example from the official site working with my collada objects (.dae) using the ColladaLoader.js . Now my question is, how do i change the loaded collada object color attribute and add a custom texture?? I tried adding the texture with no luck yet. Here is my code (slightly changed from the original example): function load_model(el) { if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var container, stats; var camera, scene, renderer, objects; var particleLight, pointLight; var dae, skin; var loader = new THREE.ColladaLoader(); loader.options.convertUpAxis = true;

Changing texture and color on Three.js collada object

☆樱花仙子☆ 提交于 2019-11-30 23:57:28
问题 I recently got three.js example from the official site working with my collada objects (.dae) using the ColladaLoader.js . Now my question is, how do i change the loaded collada object color attribute and add a custom texture?? I tried adding the texture with no luck yet. Here is my code (slightly changed from the original example): function load_model(el) { if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var container, stats; var camera, scene, renderer, objects; var particleLight,

What are the requirements for supporting Collada/DAE models in SceneKit?

一曲冷凌霜 提交于 2019-11-30 19:31:40
问题 I have received Collada (DAE) files from several different 3D authoring tools (Rhino, Blender, Cinema4D, etc) and have found that sometimes the models fail to load. Xcode does not provide any information when a model fails to load. It simply shows an alert that says "The file couldn't be opened." Are there any requirements -- specific DAE version, limited subset of features, etc -- that my 3D designer should be aware of when exporting a DAE file for me? I have, of course, searched Apple's

How to setup materials in THREE.js when loading Collada (dae) models?

狂风中的少年 提交于 2019-11-30 10:23:33
How do I setup materials in THREE.js when loading Collada (dae) models? I have the following code: new THREE.ColladaLoader().load('models/cylinder.dae', function(collada) { var model = collada.scene; model.scale.set(10.0, 10.0, 10.0); // attempt to set a material - doesn't work... collada.dae.materials[0] = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } ); scene.add(model); }); Thanks for any help. var loader = new THREE.ColladaLoader(); loader.options.convertUpAxis = true; loader.load( './models/cylinder.dae',function colladaReady( collada ) { model = collada.scene; model

How can I export DAE files for use in Scene Kit without seeing “untitled-animations”?

丶灬走出姿态 提交于 2019-11-30 05:54:24
问题 I am trying to load animations created in Cheetah 3D and Blender 3D into Scene Kit, but all I get is a bunch of "untitled-animations" with each one being the same animation. Does anyone know how to properly export these from Blender or Cheetah 3D so that Scene Kit can use them? 回答1: I dug into this because it was annoying me too. All of the "untitled animations" are individual animations for each bone. You can get the id from the attributes inspecter in the panel on the right side of xcode.

load a collada (dae) file into SCNNode (Swift - SceneKit)

点点圈 提交于 2019-11-30 04:42:35
问题 This works let scene = SCNScene(named: "house.dae") Is there an equivalent for a node? let node = SCNNode(geometry: SCNGeometry( ..??.. "house.dae" ..??.. )) I have searched high and low, finding nothing that will load an entire dae file into a SCNNode. (not just one ID from it) 回答1: // add a SCNScene as childNode to another SCNScene (in this case to scene) func addSceneToScene() { let geoScene = SCNScene(named: "art.scnassets/ball.dae") scene.rootNode.addChildNode(geoScene.rootNode

How to setup materials in THREE.js when loading Collada (dae) models?

ⅰ亾dé卋堺 提交于 2019-11-29 15:02:14
问题 How do I setup materials in THREE.js when loading Collada (dae) models? I have the following code: new THREE.ColladaLoader().load('models/cylinder.dae', function(collada) { var model = collada.scene; model.scale.set(10.0, 10.0, 10.0); // attempt to set a material - doesn't work... collada.dae.materials[0] = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } ); scene.add(model); }); Thanks for any help. 回答1: var loader = new THREE.ColladaLoader(); loader.options.convertUpAxis =

Xpath fails if an element has a a xmlns attribute [duplicate]

你离开我真会死。 提交于 2019-11-29 14:03:30
Possible Duplicate: xPath finds nothing but * Im trying to use xml to parse a .COLLADA file. The problem is I can't seem to use xpath() to access elements if the root tag has a xmlns attribute. For example this works: $string = <<<TEST <?xml version="1.0" encoding="utf-8"?> <COLLADA version="1.4.1"> <library_materials> <material id="Material" name="Material"> <instance_effect url="#Material-effect"/> </material> <material id="Material2" name="Material"> <instance_effect url="#Material-effect2"/> </material> </library_materials> </COLLADA> TEST; $lol = new SimpleXMLElement($string); print_r(

Which 3D Model format should I be using?

你说的曾经没有我的故事 提交于 2019-11-29 02:14:47
问题 Im writing a game engine and I'm wondering what 3D model format should I use/load/export? Obj seems universal and easy but it also appears to be unreliable in that most models out there contain errors and it doesn't store anywhere near as much as other formats. There appear to be formats specifically for games such as MD2/3/5 but Im not sure, I use wings3d if I model, and I don't know what other details beyond purely loading what I need and support from the format Id have to implement, such

SceneKit. Which way is up?

冷暖自知 提交于 2019-11-28 23:24:46
问题 It seems that most 3D authoring applications use Z as the 'Up' axis. While SceneKit uses Y as the 'Up' axis. SceneKit allows you to load scenes as Collada .DAE files. When loading a Scene via either: SCNScene(named: String?, inDirectory: String?, options: [NSObject : AnyObject]?) or SCNSceneSource(URL url: NSURL!, options: [NSObject : AnyObject]!) You can specify options including SCNSceneSourceConvertToYUpKey and SCNSceneSourceConvertUnitsToMetersKey. Setting these accordingly, I expected