add fov
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user