kovacsv / JSModeler

A JavaScript framework to create and visualize 3D models.
MIT License
655 stars 123 forks source link

There's no import examples, and no usage in reference #25

Open vongoethe opened 7 years ago

vongoethe commented 7 years ago

I cannot find any information about import operation. How is it used? Nothing in the examples and tutorials, even nothing in the docs. Could you please provide some information? Thanks

kovacsv commented 7 years ago

Hi!

Definitely I have to create some documentation :)

Until this I recommend you to see examples in the sandbox folder: https://github.com/kovacsv/JSModeler/blob/development/sandbox/importeralltypes.html https://github.com/kovacsv/JSModeler/blob/development/sandbox/importerdragdrop.html https://github.com/kovacsv/JSModeler/blob/development/sandbox/importerurl.html

Viktor

mauricesvay commented 7 years ago

From the examples, I understand that imported data is converted to JSON, and can only be used with ConvertJSONDataToRenderBodies for rendering. Is there a way a to merge the imported data with a JSM.Body?

My goal is to import an OBJ file, add some mesh generated with JSM and export the result to OBJ. I don't need to render with three.js. Is it possible?

kovacsv commented 7 years ago

Unfortunately this convertion is not implemented at the moment, but JSONData is a triangulated representation of the model, so it is easy to convert it to an obj file.

You can create JSONData from a model with the ConvertModelToTriangleModel and ConvertTriangleModelToJsonData functions.