dilevin / computer-graphics-final-image-competition

1 stars 1 forks source link

positioning of .stl objects in .json files #8

Open ginkxo opened 4 years ago

ginkxo commented 4 years ago

from the various resources given in A3, if I wanted to do something like place the skull on top of the mirror, or make the skull enormous, is there .json structure e.g. corresponding to scaling or position coordinates for each object? All I can see in the .json files for the "triangle soup" objects is just that they read in .stl files, without specifying anything of where in "space" the resulting triangle mesh version of the .stl object appears

darren-moore commented 4 years ago

Good idea! Unfortunately there's not any functionality for scaling or positioning the triangle soups right now; however, there are a couple ways to achieve what you want:

  1. Use e.g. Blender to position and scale the model before the A3 program imports it.
  2. Add positioning and scaling functionality to the included json parser. I don't suspect this to be too hard. See read_json.h and perform the necessary operations when importing the triangle corners. See how sphere->center = parse_Vector3d(jobj["center"]); is used, then apply to tri->corners.