Code Monkey home page Code Monkey logo

threejs-collada's People

Contributors

cauten avatar crobi avatar gero3 avatar werehamster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

threejs-collada's Issues

Improve the loader performance

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

Simple use example

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?

Can't load skeleton animation files from Cheetah3D

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.

some collada files are displayed incorrectly in webgl

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:
kitchen

The kitchen visualized with webgl (same result would be found using this tool):
kitchen_in_webgl

(Thank you very much in advance)

Backgroud loading of COLLADA files

Loading of big COLLADA files can be slow and freeze the browser tab. Ideas of improving the speed and/or responsiveness:

Web workers

  • True background execution
  • Messages passed to and from web workers are passed by value. Meshes would have to be serialized and deserialized to get them out of the web worker.
  • ArrayBuffers can be transferred by reference (destructive assignment, no copy involved). Currently only Chrome supports this. See "web workers transferable objects"

Web workers with proxies

  • In a web worker, parse the COLLADA file and create simple proxy objects that contain pre-processed geometry data in typed arrays.
  • Transfer proxy objects to the main thread (try using the fast chrome transfer of typed arrays, if possible).
  • In the main thread, create three.js objects from the proxy objects. This part unfortunately cannot be executed in the background.

Settimeout

  • Call all parsing functions asynchronously with a small delay
  • Browsers enforce a minimum delay of 2-10ms
  • No background execution, just better responsiveness

postMessage

  • enqueue all method calls in a custom queue and use window.postMessage to execute the next call in the queue
  • No background execution, just better responsiveness

Respect the up axis setting

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.

Implement SkinnedMesh output

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).

Use BufferGeometry

To avoid creating thousands of temporary THREE.Vector3 objects, use THREE.BufferGeometry instead of THREE.Geometry.

Objects loaded with this loader usually do not need to be modified after loading.

Look here or here to see how BufferGeometry works.

Really great work!

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

Collada loading with colladaLoader2.js

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

Find a new maintainer

This repository is no longer maintained (see readme).

If you are willing to take over this project, leave a message here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.