add scale options

This commit is contained in:
nicolalandro 2021-11-14 15:06:51 +01:00
parent 4c7c6eee48
commit e7b2cde1fe
2 changed files with 7 additions and 1 deletions

View File

@ -49,7 +49,7 @@
{
const objLoader = new OBJLoader();
const mesh = objLoader.parse(obj_3d['obj']);
mesh.scale.set(30, 30, 30);
mesh.scale.set({{obj_options.scale_x}}, {{obj_options.scale_y}}, {{obj_options.scale_z}});
scene.add(mesh);
}

View File

@ -42,6 +42,11 @@ def obj2html(
"target_x": -5,
"target_y": 0,
"target_z": 0,
},
obj_options={
"scale_x": 30,
"scale_y": 30,
"scale_z": 30,
}
):
with open(obj_path, "r") as f:
@ -55,6 +60,7 @@ def obj2html(
data_dict = {
"obj_3d": js_string,
"obj_options": obj_options,
"camera": camera,
"light": light,
}