From e7b2cde1fe7c6283f5505d2409d67e0ad26fb9c4 Mon Sep 17 00:00:00 2001 From: nicolalandro Date: Sun, 14 Nov 2021 15:06:51 +0100 Subject: [PATCH] add scale options --- obj2html/index.html | 2 +- obj2html/obj2html.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/obj2html/index.html b/obj2html/index.html index 6ef88c3..57247fa 100644 --- a/obj2html/index.html +++ b/obj2html/index.html @@ -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); } diff --git a/obj2html/obj2html.py b/obj2html/obj2html.py index 7f775af..2125931 100644 --- a/obj2html/obj2html.py +++ b/obj2html/obj2html.py @@ -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, }