Collada to JSON
Asked Answered
S

3

6

I try to display some Collada files with WebGL and Three.js. I tried with THREE.ColladaLoader() but it returns some materials errors.

I see it's possible to convert the file to JSON and then import it to WebGL.

I look around but didn't any solution to do that...

Any clue ?

Sula answered 30/12, 2011 at 9:52 Comment(0)
R
3

COLLADA2Json may be what you are looking for.

edit:

gltf is a starndard now. (Json + binary). The converter is here: https://github.com/KhronosGroup/collada2gltf

Rhizoid answered 20/11, 2012 at 9:49 Comment(5)
Cool ! I think it didn't exist when i posted this question :)Sula
But does it work? I've finally got it to build, but the .json file it generates doesn't appear to have any vertex data in it :(Sulk
yes, it does work. Maybe you have encountered a bug? Please open an issue on the github page.Rhizoid
This link is broken.Masson
its now a standard of its own - github.com/KhronosGroup/glTF. the converter is here: github.com/KhronosGroup/collada2gltfRhizoid
E
2

One option could be to import the Collada file into Blender.

If it survives importing and still looks as expected, you could then export it from there using the THREE.js's Blender exporter .

Electrocardiogram answered 16/11, 2012 at 10:5 Comment(0)
D
1

Collada is notoriously difficult to parse. If you have one that doesn't parse, you'll have to write your own parser or fix one that you want to use. I gave up trying to use collada because of that, I'm now using 3DS files

Dicho answered 4/1, 2012 at 23:3 Comment(1)
I found a nice solution, it's a plugin for Sketchup wich export directly to Three.js => github.com/timjb/sketchup-threejsSula

© 2022 - 2024 — McMap. All rights reserved.