dilevin / computer-graphics-final-image-competition

1 stars 1 forks source link

stl and json files from a model? #7

Open Cheryl-Lao opened 4 years ago

Cheryl-Lao commented 4 years ago

If I want to import a new model into my final image, how do I generate the json file to set the materials? I found lots of ".___ to .stl" converters but I'm not sure how to assign materials using a corresponding json file like in A2 & A3

darren-moore commented 4 years ago

Ah, are you interested in using multiple materials on a single model? I think A3's json parser only supports one material per object. One solution might be splitting your .stl into multiple .stl's- one for each material you need. Another option could be UV mapping, but you reference a material rather than a texture.

To expand, triangle mesh data is more standardized than something like a material. The way something looks is less well defined than a set of positions, faces, etc. Each renderer needs a different set of variables depending on which lighting model it's using. Unfortunately we haven't written any material importers for the popular file formats.

Cheryl-Lao commented 4 years ago

Oh okay thank you! I think I'll just stick to arranging simpler objects with solid colours then.