RiftSketch icon indicating copy to clipboard operation
RiftSketch copied to clipboard

Add ability to import existing 3D objects.

Open brianpeiris opened this issue 9 years ago • 2 comments

brianpeiris avatar Oct 07 '14 12:10 brianpeiris

Three.js has a fair few number of model importers. They all work in subtly different ways.

I currently use the Collada loader to import an entire scene, that had been exported out of Blender, as a "level file". There are some problems with it, though, I think mostly stemming from Blender's Collada exporter being buggy and incomplete.

First, it maintains Blender's axes, which aren't the same as the Three.js default. Blender has Y as up, Three uses Z as up. You can change the up vector in Three.js, but there are a lot of plugins (like the Mirror material) that make bad assumptions about what "up" means.

Second, I've also noticed that some light colors have a swapped red and green value. No, not a swapped red and blue value, which would make some sort of sense, to have BGR instead of RGB. Lights seem to be GRB, but flat-colored materials are still RGB.

Third, there's no support for extended attributes. I personally would like to use attributes to support different types of interaction data. Collada does have metadata capabilities, but Blender doesn't implement it in the exporter.

I wish I had skipped Collada and stuck to Three.js' own JSON format, for which they have a Blender plugin available. I'm having some trouble converting over right now, thanks to all of the axes issues. But it does have options to be able to export scenes or single models, as well as an option to translate the axes. I'd suspect it's easier to extend, as well, as I hope to do to support placing 3D audio elements.

capnmidnight avatar Oct 07 '14 13:10 capnmidnight

Oh man. Thanks for all the valuable comments! I'll try to respond to them in detail soon.

brianpeiris avatar Oct 07 '14 13:10 brianpeiris