rmx / threejs-collada Goto Github PK
View Code? Open in Web Editor NEWAn alternative COLLADA loader for the three.js project
An alternative COLLADA loader for the three.js project
Try compiling the code using googles closure compiler. All threejs functions have to be declared as externs.
Profile for loading an 800K face mesh (dragon). Almost 50% of the time spent in the garbage collector....
(garbage collector) | 2737.95 | 2737.95 |
onFileLoaded | 1632.97 | 6015.88 |
ColladaLoader2._strToInts | 1020.98 | 1774.96 |
ColladaLoader2._strToFloats | 764.98 | 1482.97 |
ColladaLoader2._addEmptyUVs | 250.00 | 255.99 |
ColladaLoader2._addTrianglesToGeometry | 170.00 | 744.99 |
(program) | 164.00 | 164.00 |
ColladaLoader2._floatsToVec3 | 122.00 | 128.00 |
ColladaLoader2._createVector3Array | 112.00 | 241.00 |
THREE.Geometry.computeCentroids | 102.00 | 102.00 |
THREE.Geometry.computeFaceNormals | 87.00 | 115.00 |
THREE.Face3 | 76.00 | 76.00 |
ColladaLoader2._parseSourceChild | 62.00 | 1544.97 |
ColladaLoader2._parseTrianglesChild | 60.00 | 1834.96 |
THREE.Vector3.isZero | 24.00 | 24.00 |
THREE.Geometry.computeBoundingBox | 11.00 | 11.00 |
THREE.Geometry.computeBoundingSphere | 10.00 | 17.00 |
THREE.Vector3.length | 7.00 | 7.00 |
ColladaLoader2._createGeometry | 6.00 | 978.98 |
ColladaLoader2._applyUpConversion | 6.00 | 6.00 |
ColladaLoader2._strToInts | 5.00 | 5.00 |
THREE.Vector3.copy | 4.00 | 4.00 |
ColladaLoader2._strToInts | 2.00 | 2.00 |
logMessage | 1.00 | 1.00 |
logMessage | 1.00 | 1.00 |
ColladaLoader2._parseColladaChild | 1.00 | 3382.93 |
ColladaLoader2._parseSceneNode | 1.00 | 1.00 |
ColladaLoader2._createMesh | 1.00 | 996.98 |
THREE.Vector3.clone | 1.00 | 1.00 |
setLineBuffers | 1.00 | 1.00 |
(anonymous function) | 1.00 | 1.00 |
THREE.Geometry.computeFaceNormals | 1.00 | 1.00 |
THREE.Vector3.copy | 1.00 | 1.00 |
(root) | 0.00 | 8919.82 |
logActionEnd | 0.00 | 1.00 |
logActionStart | 0.00 | 1.00 |
ColladaLoader2.parse | 0.00 | 4380.91 |
ColladaLoader2._parseXml | 0.00 | 3382.93 |
ColladaLoader2._parseLibGeometryChild | 0.00 | 3380.93 |
ColladaLoader2._parseGeometryChild | 0.00 | 3380.93 |
ColladaLoader2._parseMeshChild | 0.00 | 3380.93 |
ColladaLoader2._parseSource | 0.00 | 1544.97 |
ColladaLoader2._parseVertices | 0.00 | 1.00 |
ColladaLoader2._parseVerticesChild | 0.00 | 1.00 |
ColladaLoader2._parseInput | 0.00 | 1.00 |
ColladaLoader2._parseTriangles | 0.00 | 1834.96 |
ColladaLoader2._parseLibVisualSceneChild | 0.00 | 1.00 |
ColladaLoader2._parseVisualSceneChild | 0.00 | 1.00 |
ColladaLoader2._createSceneGraph | 0.00 | 996.98 |
ColladaLoader2._createSceneGraphNode | 0.00 | 996.98 |
THREE.Mesh | 0.00 | 17.00 |
Hi! I am trying to figure out how to use ColladaLoader2, but the included view.js is pretty fancy. I don't need to be able to drag and drop files or textures or do animation, I just want to make a webpage that will load a Collada model and let me rotate/pan/zoom. Could you add a small HTML file demonstrating the bare minimum needed to use ColladaLoader2?
For some reason it is not possible to load collada files exported from Cheetah3D. It claims that it cannot find the skeleton for a skinned mesh:
ColladaLoader2 ERROR: Controller instance for a skinned mesh has no skeleton, mesh ignored
Sample file is uploaded to: http://noseglid.github.io/chump.dae
This may very well be an issue with the Collada export for Cheetah3D. I'll check on both ends.
First of all, thank you very much for this tool. The robotics community really appreciates it :).
I came across this collada parser as part of the http://robotwebtools.org/ project and most of the time, it works great. However we do see sometimes that, some collada files get loaded incorrectly. By that I mean, some textures aren't loaded at all, some textures look bad and some of the "parts" of the drawing are missing altogether. Some other folks that use the robot web tools have experienced the same thing....in general, the community has been using this tool to see which dae files load well and which ones don't - and then chooses meshes for their projects this way.
We were wondering whether anyone knows why this happens? Maybe there is some way we can preprocess our meshes to prevent it? Is this related to how some submeshes are described in the file? Any advice or clues would be appreciated.
For example, we downloaded and modified this kitchen from 3dwarehouse (we removed the ceiling and some other parts). The modified version is hosted here in dae, stl, skp format.
The kitchen visualized with webgl (same result would be found using this tool):
(Thank you very much in advance)
Loading of big COLLADA files can be slow and freeze the browser tab. Ideas of improving the speed and/or responsiveness:
Hi!
Would it be possible to have some Git releases/tags? (e.g. https://github.com/mrdoob/three.js/releases) This would make the life of packagers easier :-)
Hi, is there a plane to convert collada to json for three.js
Sadly many exporters like the OpenCollada one fpr 3ds Max (the built-in doesn't work for other reasons for me) don't offer any setting for this.
So just like the original Collada loader a setting should be offered. Currently, the up_axis setting is currently being ignored, I don't know what the official three.js stance is but I would guess that the norm should be that the y axis is always up just like everywhere in real-time graphics so should this feature be implemented than the flipping should be done automatically depending on this setting.
Currently, the loader generates MorphMeshes for skin animated meshes in the collada file. It shouldn't be difficult to output SkinnedMeshes (there's already an option for that).
There is a project which reads COLLADA files and transforms them into an xml file with meta-data and a binary file with vertex/mesh data, in a format suitable for webgl. The project looks promising, but is work in progress and can not replace a collada loader at this time.
Hi,
Apologies for cluttering your issue tracker with gushing praise; I'm never sure what the best way to do "general chat" is on github.
Anyway, I just wanted to say thank you so much for this fantastic work. After pulling my hair out with the official ColladaLoader, I was REALLY delighted when I found your loader last night. Finally, my animations work perfectly!
view.html is a really excellent little debugging tool and with some picking through it's easy enough to see how to use your loader.
I think you're happy enough to not be part of the main Three codebase, but it did occur to me that a minimum example done in exactly the same style as the other Three.js samples could go a look way towards getting more people to use this great loader.
Best regards,
Fell
Hi,
I try to implement your loader, but i don't understand :
This is my code with colladaLoader.js :
objloader = new THREE.ColladaLoader();
objloader.load(dae, function colladaReady(collada) {
element = collada.scene;
THREE.SceneUtils.traverseHierarchy(element, function(node) {
node.material = material;
});
});
What is the code with ColladaLoader2.js to make same thing ?
Thanks in advance
This repository is no longer maintained (see readme).
If you are willing to take over this project, leave a message here.
I've seen now several files (e.g., from Sketchup) using this feature.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.