From 85836c54343b4f386b7717df9611821ca75d4f69 Mon Sep 17 00:00:00 2001 From: nicolalandro Date: Sun, 14 Nov 2021 09:15:05 +0100 Subject: [PATCH] add fov --- obj2html/index.html | 2 +- obj2html/obj2html.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/obj2html/index.html b/obj2html/index.html index eb507dc..0217668 100644 --- a/obj2html/index.html +++ b/obj2html/index.html @@ -14,7 +14,7 @@ const canvas = document.querySelector('#c'); const renderer = new THREE.WebGLRenderer({canvas}); - const fov = 45; + const fov = {{fov}}; const aspect = 2; // the canvas default const near = 0.1; const far = 100; diff --git a/obj2html/obj2html.py b/obj2html/obj2html.py index 366b17f..9a3d15b 100644 --- a/obj2html/obj2html.py +++ b/obj2html/obj2html.py @@ -4,7 +4,7 @@ import json TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'index.html') -def obj2html(obj_path, output_html_path=None): +def obj2html(obj_path, output_html_path=None, fov=45): with open(obj_path, "r") as f: content = f.readlines() content = '\n'.join(content) @@ -14,6 +14,7 @@ def obj2html(obj_path, output_html_path=None): with open(TEMPLATE_PATH, "r") as f: html_template = f.read() html_string = html_template.replace("{{obj_3d}}", js_string) + html_string = html_string.replace("{{fov}}", str(fov)) if output_html_path != None: with open(output_html_path, "w") as f: